Re: Undo logic location?
Re: Undo logic location?
- Subject: Re: Undo logic location?
- From: Jim Correia <email@hidden>
- Date: Thu, 6 Jan 2005 09:12:54 -0500
On Jan 6, 2005, at 1:51 AM, Tom Davies wrote:
and I set the owner of the Catalogue to the MyDocument instance, but
I'd rather not have undo logic in my model at all.
1. Where does the undo logic belong?
That's a good question.
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
See the section on undo. You can put undo in the model (but you have to
have some way of getting the undo manager to the model objects) or you
can observe in say the model-controller (document) and do as you did.
Aaron's example is fairly simply in terms of the model. A flag list of
Persons, each with two properties. The observer method for undo doesn't
feel like it would scale well to more complicated models, perhaps with
more properties, and objects that themselves contained arrays of
different model objects.
The method of giving the model objects an undo manager seems straight
forward enough. One potential problem I see with this is that getting
the undo name right may require some controller code that is aware of
higher level actions.
Does anyone have experience with using this in a real world sized
system? Which approach worked better (or not) and why?
Thanks,
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden