discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOKeyValueCoding


From: Richard Frith-Macdonald
Subject: Re: EOKeyValueCoding
Date: Wed, 14 Nov 2001 12:38:24 +0000

On Wednesday, November 14, 2001, at 12:05 PM, Gerrit Van Dyk wrote:

Hi all,

On the DB Library subject, if i change the DB Library to use
NSKeyValueCoding instead of EOKeyValueCoding, should I transfer the methods in EOKeyValueCoding to valueForKey in Foundation or should I stay with the implementation of Foundation? It just looked to me, I did not investigate,
that the methods that does essentially the same as valueForKey in the DB
library, is better implemented ie uses caching of method names, ivar's etc
to enable valueForKey to get to the answer quicker.

Unfortunately not quite that simple ...

the code in the db library suffers from various faults wrt the code in NSObject - 1. It's old, and does not conform to the currently documented API, so would need updating
2. It's not thread-safe (the cache needs lock protecting)
3. Access to instance variables is runtime dependent
4. Some bugs known ... but probably not significant ones ... for instance, this code won't work if the accessor methods are performed by a delegate or if the object is a proxy for
another object (but who cares?)

As far as I know, the code in NSObject only has one fault - but it's a biggie - it's *very*
slow by comparison with the db code.

So what really needs to be done is for new code to be written.

I'd suggest it is probably easier to start with the NSObject code and optimise and implement thread-safe caching than it is to work from the other end, simply because the NSObject code
is (because it's unoptimised) easier to understand.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]