Re: Subclassing best practice
Re: Subclassing best practice
- Subject: Re: Subclassing best practice
- From: Uli Kusterer <email@hidden>
- Date: Wed, 14 Nov 2007 19:34:07 +0100
Am 14.11.2007 um 18:39 schrieb John Stiles:
This works great. However, from a code design perspective, it seems
sloppy to me. I don't like having to rely on macros.
In other languages, I could use multiple inheritance, (...) But ObjC
doesn't support multiple inheritance.
There are a few cases where I used a Macro, too, but in most cases,
stepping back and looking at the code again helped me find a better
design that didn't need multiple inheritance:
E.g. often when I was adding members to a basic class like NSWindow,
what I really wanted was to have a common base class for my window
delegates (i.e. the controller), or to add these members to my model
somewhere. Or sometimes, just splitting the controller into several
classes helped.
Sometimes, categories helped, too.
And also, with ObjC 2.0, one can apparently add properties to
existing objects somehow. I think this came up on ObjC-Langauge a
couple days ago.
Cheers,
-- M. Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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