• 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: Better to chain key path dependencies, or list explicitly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Better to chain key path dependencies, or list explicitly?


  • Subject: Re: Better to chain key path dependencies, or list explicitly?
  • From: Ken Thomases <email@hidden>
  • Date: Tue, 19 May 2009 22:39:12 -0500

On May 19, 2009, at 6:24 PM, Rick Mann wrote:

I have some key paths dependent on other paths. I'm using +keypathsForValuesAffectingFoo to set up the dependency.

Now I have a chain of dependencies: A -> B -> C. Is it better to just have B depend on C, and A depend on B, or should A explicitly depend on B and C?

I would say that it should follow the implementation of property A. Is property A implemented by directly using property C, or only property B?


From a maintenance perspective, you don't want to introduce dependencies where you don't have to. Somebody should be able to reproduce +keypathsForValuesAffectingA by looking at -a and -setA: and whatever other methods constitute the implementation of A.

Put another way, somebody changing the implementation (not the interface nor contract) of B should not have to go around to all of the properties that might depend on B and check how they were written. B's implementation should be local to itself and should not leak into the implementation of A.

Cheers,
Ken

_______________________________________________

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: Better to chain key path dependencies, or list explicitly?
      • From: Rick Mann <email@hidden>
References: 
 >Better to chain key path dependencies, or list explicitly? (From: Rick Mann <email@hidden>)

  • Prev by Date: Only One Reason to ever use Transient Properties in Core Data
  • Next by Date: Re: Better to chain key path dependencies, or list explicitly?
  • Previous by thread: Better to chain key path dependencies, or list explicitly?
  • Next by thread: Re: Better to chain key path dependencies, or list explicitly?
  • Index(es):
    • Date
    • Thread