• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Undo in an old school data model
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Undo in an old school data model (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: Adding an image to a NIB file
  • Next by Date: Re: Crash within Cocoa with Guarded Malloc
  • Previous by thread: Undo in an old school data model
  • Next by thread: Omni frameworks updated for Xcode 2.2
  • Index(es):
    • Date
    • Thread