• 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: ArrayController, CoreData & Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ArrayController, CoreData & Bindings


  • Subject: Re: ArrayController, CoreData & Bindings
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 10 May 2006 20:15:45 -0700


On May 9, 2006, at 8:25 AM, Bobby B wrote:

Just out of curiosity, why is it "wrong" to do it that way?

It's just poor design.

Controllers are for managing the interaction between your model objects and your human interface.

If you use a controller to set up default data, you're making your application architecture fragile. What happens when you change your user interface? What happens when you subclass the controller to do custom initialisation of its new objects? Why add the overhead of manipulating the user interface to get a reference to an object you should be in charge of anyway...? Why (assuming you're using the document architecture) use the contents of the array controller to determine whether or not data has been initialised when there is API available precisely for set-up? Why (assuming you're not using the document architecture) not use a more reliable means of determining whether or not this is the first run of the application than just the count of object in the UI element?

There are probably many other considerations, but these should be enough for now...

mmalc

_______________________________________________
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: 
 >ArrayController, CoreData & Bindings (From: "Bobby B" <email@hidden>)
 >Re: ArrayController, CoreData & Bindings (From: Greg Herlihy <email@hidden>)
 >Re: ArrayController, CoreData & Bindings (From: "Bobby B" <email@hidden>)

  • Prev by Date: Re: Cocoa software design issue
  • Next by Date: Re: Weird error with structs and @try/@catch
  • Previous by thread: Re: ArrayController, CoreData & Bindings
  • Next by thread: Re: ArrayController, CoreData & Bindings
  • Index(es):
    • Date
    • Thread