• 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: Listening to bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Listening to bindings


  • Subject: Re: Listening to bindings
  • From: Scott Stevenson <email@hidden>
  • Date: Fri, 18 Feb 2005 15:31:20 -0800


On Feb 18, 2005, at 8:00 AM, Guy English wrote:

My question would be ... why? Is there some reason your model objects
can't manage this themselves? You know when one of your models gets
created ( init ) you know when it gets deleted ( dealloc ) and you
know when it's state changes ( through accessors ). Why do you want a
third party sticking it's nose in there? The only thing I can think of
is that you're using NSDictionaries instead of actual model classes -
if you are: don't. :)

A follow-up to my last email...

I don't believe -init/-dealloc are good places to manage database updates. Not only are there all sorts of a reasons (other than deletion) that an object may be deallocated, but you could easily have a situation where an object is removed from an array but not deleted. I also think data objects generally shouldn't speak directly to a database, but rather notify a delegate about changes via KVO.

I really think you should observe changes to the source array in order to know when things should be deleted or inserted in the db.


- Scott

--
http://treehouseideas.com/
http://theocacao.com/ [blog]

_______________________________________________
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


  • Follow-Ups:
    • Re: Listening to bindings
      • From: Guy English <email@hidden>
References: 
 >Listening to bindings (From: <email@hidden>)
 >Re: Listening to bindings (From: Guy English <email@hidden>)

  • Prev by Date: Re: Getting the pixels from an NSImage
  • Next by Date: Re: Using custom framework
  • Previous by thread: Re: Listening to bindings
  • Next by thread: Re: Listening to bindings
  • Index(es):
    • Date
    • Thread