Re: Changing classes
Re: Changing classes
On 30 Sep 2010, at 20:35, Allen Ingling wrote:
> On Thu, Sep 30, 2010 at 2:28 PM, Remco Poelstra <email@hidden> wrote:
>
>> Hi,
>>
>>
> Maybe a class cluster would be useful here?
>
Clustering might be a solution but it's a bit of a heavyweight pattern.
Trying to dynamically match a stepwise revealed information structure to a particular class in a hierarchy sounds fragile.
If an individual hardware item property doesn't match the class hierarchies expectations then you have to subclass.
If a specific class is not necessary for each hardware item then it might be possible to think in terms of a single
or small number of generic classes.
The specificity of these base classes can be extended by the use of associative storage property (an NSDictionary instance).
ie: dump all the hardware properties into the dictionary then query it as and when required.
This would give a lot of type flexibility without excessive subclassing.
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com
_______________________________________________
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