Re: exception in class derived from NSMutableDictionary
Re: exception in class derived from NSMutableDictionary
- Subject: Re: exception in class derived from NSMutableDictionary
- From: Robert G Palmer Jr <email@hidden>
- Date: Wed, 30 Jul 2003 14:03:56 -0400
I guess it's a grey area. I have a collection of sensors. If I say it
is a "has-a" relationship, then I'll be writing pass through methods
for every dictionary call I want - except the two special ones I have
shown. The pass through methods won't do anything special, just call
the super class. That's what got me to thinking it is really an "is-a"
relationship. I originally wrote it as a "has-a" relationship.
One advantage to the "has-a" relationship, which is probably a good
argument to going back "has-a" is that it hides the implementation.
However, from the user's perspective, each item in the collection is
accessed via the MAC address as the key, which points back to "is-a"
because that approach to accessing (using the MAC as a key) implies a
dictionary.
I chose "is-a" because it saves writing code.
Comments and suggestions openly appreciated.
Thanks for all the info and pointers.
Robert Palmer, Jr
email@hidden
On Wednesday, July 30, 2003, at 01:48 PM, Dylan Adams wrote:
Are you sure this isn't a has-a relationship instead of an is-a
relationship? That is, could your class VideoSensorCollection just
have an NSMutableDictionary instance variable that you then cover
with some add and remove methods instead of subclassing?
I agree.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.