Where does Undo fit in MVC
Where does Undo fit in MVC
- Subject: Where does Undo fit in MVC
- From: Marcus Roberts <email@hidden>
- Date: Sat, 23 Apr 2005 10:28:39 +0100
I've been working my way through Bill Cheeseman's Cocoa Recipes, which
has been an excellent lesson in getting used to the Cocoa way of doing
things.
One thing it did make clear was just how much glue code was needed
before Cocoa Bindings appeared in 10.3. I've now gone back to the
start of the recipies and I've reimplemented the application using
bindings.
There's still a lot of glue code needed, which is why I'm looking
forward to Core Data arriving in 10.4. For the moment though, I'm
going to continue coding for 10.3 until I get my hands on XCode 2 next
week.
I'm currently confused though as to where undo management should go.
The cocoa recipies have many calls to the undo manager in the model
itself, with additional undo management in the window controller.
This feels a little wrong, as I would expect the model data to not
know about the document or its undo manager. The Hillegass book in
Chapter 7 moves the undo code into the document object, and uses KVO
to determine when the model has changed. This feels more in line with
MVC.
But from what I've read on the Apple site, Core Data will provide the
undo/redo management, down in the model.
Is my understanding of Core Data right? Is it just the case that for
10.3 undo should be done in the document controller, but 10.4 is going
to push it into the managed model data - in fact, Core Data is really
a model with controller code on top?
Thanks
Marcus
_______________________________________________
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