Re: Class clusters - infinite loop?
Re: Class clusters - infinite loop?
- Subject: Re: Class clusters - infinite loop?
- From: Wade Tregaskis <email@hidden>
- Date: Mon, 27 Jun 2005 18:50:05 +1000
Far as I can say, the reasonable pattern is that the cluster would
offer a number of init's: one designated (quite probably just
"init", quite probably just inherited, it would be sent from the
hidden subclasses inits), and any number of "initWithWhatevers",
which would return instances of hidden subclasses, and,
*naturally*, would *not* be sent from their inits.
What's the problem? I might be blind, but I don't see the slightest
one.
This is the compromise I suggested - it's good to see it's been well
received. The problem now stands with documentation - I can't find a
single reference to the word "cluster" in any of the Foundation
documentation*. To be more specific, if I pick any typical class
cluster like the NS collections, there is no instruction as to which
initialiser(s) return self, which return a new instance, etc. Aside
from the usual "I don't really want to poke the black box" laziness,
it's Very Badâ„¢ to go assuming undocumented behaviours.
Also, for those reading this thread who haven't read it yet, <file:///
Developer/ADC Reference Library/documentation/Cocoa/Conceptual/
CocoaObjects/Articles/ClassClusters.html> covers a lot of the basics
about clusters, including subclassing. As it says, you really
shouldn't create a class cluster if you are ever likely to have a
need to subclass it, which I'm still tending towards. But, the
alternative being discussed could work just as well.
* = Albeit only using Spotlight, which on my system at least works
sporadically at best.
Wade Tregaskis (AIM/iChat, Yahoo & Skype: wadetregaskis, ICQ:
40056898, MSN: email@hidden, AV iChat & email:
email@hidden, Jabber: email@hidden)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden