Re: Undo in an old school data model
Re: Undo in an old school data model
- Subject: Re: Undo in an old school data model
- From: Jeff LaMarche <email@hidden>
- Date: Tue, 4 Oct 2005 13:46:10 -0400
On Oct 4, 2005, at 1:27 PM, AgentM wrote:
The reason that you want to put undo in the controller layer is so
that you model does not have to take account of user actions- the
purpose of a model is to simply maintain its state as coherently as
possible.
By putting undo in the model, there will be many false positive
undo situations where the user asks "huh? When did I do that?" when
the program performed something programmatically behind the user's
back. Also, a grouped undo which operates on multiple objects is
suddenly much more difficult when you put undo into the models.
The issue is, if you're using Cocoa bindings but NOT using Core Data,
how do you support Undo. The whole point of Cocoa Bindings is to
avoid having to write specialized IBAction methods.
Yes, I know there's KVO, but it has essentially the same weakness -
if your observer class registers an undo every time it observes a
change, you're accomplishing the same exact thing that putting the
undo code in the model does. It's a little cleaner, academically
speaking, but the result is the same.
Or maybe I'm missing something... certainly possible. Is there a
"best practices" for implementing undo with bindings (but without
Core Data), without getting false positives?
_______________________________________________
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