Re: Action based undo or snapshot based undo? Summary!
Re: Action based undo or snapshot based undo? Summary!
- Subject: Re: Action based undo or snapshot based undo? Summary!
- From: Marco Scheurer <email@hidden>
- Date: Fri, 7 Feb 2003 16:07:49 +0100
On Friday, February 7, 2003, at 02:22 PM, Alexander Lamb wrote:
It will also often turn out to be very common to change many related
objects or many related attributes in the same event, so it can be a
big efficiency win to coalesce notifications so that your controllers
and UI don't need to do more work dealing with intermediate states of
the model objects. I.e. set up a structure where you can delay
notifications. Instead of notifying on every attribute change, mark
the
object as "hasChanges" and then post-process your model at the end of
the event and have every changed object send a single notification
then.
Absolutely. You could probably easily achieve this by having the
association
objects listen to the notifications but not process them. Each new
notification replacing the old one (for that one association of
course).
Then at the end, send a "process changes" to have the association
reflect
the UI changes.
Now, to have something happen really at the end of the event loop, my
"solution" would be to queue an event in the event loop upon receiving
the
first notification in an association object (could be a class method
keeping
a global state for the event loop).
Isn't it what EOAssociation did in desktop EOF days? EOAssociation was
a subclass of EODelayedObserver. The UI was generally refreshed only
once at the end of the run loop, independantly of how many willChange
messages were sent.
No, but the advantages are numerous.
It is true that an EOAssociation clone would benefit many applications,
even when no database is involved. Most Cocoa applications have
preference panels and inspectors, made mostly of standard widgets. Not
having to write all that boring glue code in controllers would be great.
I am wondering, since you certainly
have more contacts with engineering than me (at least recently), if
you have
the feeling the Cocoa team could be working on something like that? It
would
be a pitty to start a generic framework of associations/display groups,
etc... To have Apple come out with an "advanced UI manager" at WWDC!
I don't know about Apple, but Mulle KybernetiK demonstrated an
EOInterface clone in Amsterdam last year
(
http://www.objectfarm.org/Activities/Events/2002-Q3/WocoaPowWow.html).
There could be other efforts on the way, maybe around GNUstep and GDL.
Marco Scheurer
Sen:te, Lausanne, Switzerland
http://www.sente.ch
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.