Re: Best pattern for similar objects with differences
Re: Best pattern for similar objects with differences
- Subject: Re: Best pattern for similar objects with differences
- From: Kirk Kerekes <email@hidden>
- Date: Thu, 5 Nov 2009 07:18:54 -0600
I would also take a close look at what you are modeling -- is it
doors, or a catalog representation of doors? It might work better to
model the attributes of doors themselves and then map those attributes
to the catalog representation(s).
What, for example, actually distinguishes a SLFlushDoor from a
SLMonumentalDoor? It isn't the name, it is a set of physical
differences in the actual doors. If you model the doors, the catalog
listings become a small subset of the total variety of possible doors,
and your system will accommodate new varieties without a heart-
transplant.
If you model the physical object details rather than the catalog
representation, conversion between doors should become more obvious
and less error-prone.
As much as possible, model the thing itself, and not some predefined
abstraction of the thing. Your model will be an additional
abstraction, and that starts to get pretty abstract -- and fragile.
Most existing commercial abstractions of physical objects (catalogs,
etc) are not well thought out, and basing your model on them is a
guarantee of logical issues down the road.
This approach will, of course, require that you really understand the
doors.
_______________________________________________
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