On Mar 14, 2012, at 1:12 AM, Andreas Grosam wrote:

> The more OO like approach is to create corresponding sub subclasses for class 
> "Transport", e.g. AirTransport, GroundTransport, and possibly a factory class 
> which creates such instances.

Yup. I’ve learned over time that “switch(something->type)…” (or the equivalent 
chained if-else-if... series) is a code smell that warns me that I’m 
re-implementing inheritance, and should consider a class hierarchy instead.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

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

Reply via email to