Re: Key-Value Observing implementation

2005-06-22 Thread Gregory John Casamento
Richard,

--- Richard Frith-Macdonald [EMAIL PROTECTED] wrote:

 On 2005-06-18 04:19:02 +0100 Gregory John Casamento
 [EMAIL PROTECTED] wrote:
 
  Sa¹o,
  
  --- Sa¹o Kiselkov [EMAIL PROTECTED] wrote:
  Hi. I'm working on a CoreData implementation for GNUstep, but that depends
 
  on
  the Key-Value Observing feature. Is somebody already working on it, or may
 I
  start it?
  
  I may not be starting on this right away and I don't want to hold you up.  
 If
  you are ready to start, please go ahead and implement whatever you feel you
  need to.
 
 Sounds like my partial implementation is the most advanced code we have at
 present then.
 I could commit it to CVS as a work in progress, or provide it in some other
 way if it's needed.

I agree.  We should start with your implementation, since it sounds like it's
furthest along.

 It implements all the trickier parts of KVO, but misses out all the boring
 details :-)
 
 The implementation is not as described in the page I put on the wiki ...
 after I wrote that I came to the conclusion that the method using a proxy
 would be too slow and inefficient, so what I actually wrote was code to use
 the runtime to create an observer subclass for each class being observed, and
 change the isa ivar of any observed object to point to that subclass, which
 could handle the observatiuon process, but perform all other methods at the
 same speed as the original.

I think this is okay.  In fact, I believe that Apple does it more or less the
same way.

Later, GJC

Gregory John Casamento 
-- CEO/President Open Logic Corp. (A MD Corp.)
## Maintainer of Gorm (IB Equiv.) for GNUstep.


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Key-Value Observing implementation

2005-06-17 Thread =?iso-8859-2?b?U2G5bw==?= Kiselkov
Hi. I'm working on a CoreData implementation for GNUstep, but that depends on
the Key-Value Observing feature. Is somebody already working on it, or may I
start it?



___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Key-value observing

2005-03-02 Thread Stefan Urbanek
Hi,

Is anyone working on the Key-value observing?

http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueObserving/index.html

In the documentation one can read:

Automatic key-value observing is implemented using a technique called
isa-swizzling. 

The isa pointer, as the name suggests, points to the object's class which
maintains a dispatch table. This dispatch table essentially contains pointers
to the methods the class implements, among other data. 

When an observer is registered for an attribute of an object the isa pointer of
the observed object is modified, pointing to an intermediate class rather than
at the true class. As a result the value of the isa pointer does not
necessarily reflect the actual class of the instance. 


Is it difficult to implement it in GNUstep? If not, what is needed?

If noone is working on it and if someone skilled knows how to implement it or
has some hints, please write notes for others here:

http://mediawiki.gnustep.org/index.php?title=Key_Value_Observingaction=edit

Thanks,

Stefan Urbanek
--
http://stefan.agentfarms.net

First they ignore you, then they laugh at you, then they fight you, then
you win.
- Mahatma Gandhi


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev