Re: NSWindowController, owner, "primary window"...
Re: NSWindowController, owner, "primary window"...
- Subject: Re: NSWindowController, owner, "primary window"...
- From: Negm-Awad Amin <email@hidden>
- Date: Thu, 21 Aug 2008 19:12:06 +0200
Am Do,21.08.2008 um 06:10 schrieb Graham Cox:
On 21 Aug 2008, at 5:13 am, Gerd Knops wrote:
That'd work, but I'd have to subclass NSWindowController for that
so I can add that property. Seemed to me that the above would not
be an uncommon pattern and there ought to be a more elegant way
that I might have missed.
Yep, that's the usual approach. What's the problem with subclassing?
An unsubclassed NSWindowController isn't really all that useful. Why
is subclassing so often referred to as "inelegant"?
Probably because the GoF prefers combination over (?) subclassing.
Subclassing always discloses parts of the implementation of a class.
("white-boxing") So generally it is a good idea, to look for
alternatives for subclassing, esp. delegates.
But, of course, sometimes a subclass is simply the right thing.
That's what OOP is for.
Not all OOP languages use classes. I. e. look at SELF, a prototype-
based language.
But Objective-C is a class-based language, yup.
Cheers,
Amin
Graham
_______________________________________________
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
Amin Negm-Awad
email@hidden
_______________________________________________
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