Re: Better to chain key path dependencies, or list explicitly?
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