Op 30-9-2010 21:58, Quincey Morris schreef:
It's not at all obvious that having your class(es) "represent" your
hardware is the right way to approach this.

What are you actually trying to achieve? If the various kinds of
hardware are differentiated by their "properties", then a single
class encapsulating the possible properties (including a
specification of which properties are actually present for each
device) may be all that you need.

You would only use a class hierarchy if the class has significant
shared *behavior*, plus behavior that is specific to each device
type. Note that I'm talking about class behavior, not device
behavior. The device behavior isn't relevant to the class behavior,
unless the class is a software simulation of the device.

Hi,

Thanks for all answers! Seems there are a lot of possibilities solving such a simple thing :)

I'm representing network enabled amplifiers, some of which have multiple inputs, some not. Other have surveillance features build in, which others might not have. I'm not trying to simulate them, just representing them so I can communicate with them. I think I do not fully understand the difference you are trying to make between device and class behaviour. The amplifiers do a lot the same, but some responses might need another interpretation. In the end, all communication is over a standard protocol for all amplifiers and I want the UITableview on my iPhone to show more or less (depending on capabilities of course) the same layout.

Kind regards,

Remco Poelstra
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to