• 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: MVC question about updating the Model
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MVC question about updating the Model


  • Subject: Re: MVC question about updating the Model
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 16 Apr 2010 11:00:29 -0700

On Fri, Apr 16, 2010 at 10:51 AM, Quincey Morris
<email@hidden> wrote:
> For timed updates, you seem to have a choice of putting the timer in your data model, or putting the timer in your window controller. One good way to decide this is to ask yourself this question:

And this is when I become a fan of splitting the "model" layer into a
"model object" layer and a "model controller" layer. The "model
object" layer just contains a bunch of bags-o-data. In simple
applications this might be a few NSDictionaries; in more complicated
apps it might be a Core Data object graph. But the objects themselves
are concerned only with storing and retrieving data associated with
themselves; maybe some simple validation like "this property can't be
null" or "only one of these two properties can be set."

But the real business logic would live in the "model controller"
layer, which deals with entire graphs of model objects. This is really
where the heavy lifting goes; things like saving/loading,
calculations, or even periodic updates. It stores the results of these
sorts of operations inside the dumb-bags-of-data. It's this layer that
the view-controllers like NSWindowController or NSViewController talk
to.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: MVC question about updating the Model
      • From: Quincey Morris <email@hidden>
References: 
 >MVC question about updating the Model (From: Matt DeFoor <email@hidden>)
 >Re: MVC question about updating the Model (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: MVC question about updating the Model
  • Next by Date: Re: How to empty the Trash programmatically?
  • Previous by thread: Re: MVC question about updating the Model
  • Next by thread: Re: MVC question about updating the Model
  • Index(es):
    • Date
    • Thread