Mutable classes and class clusters
Mutable classes and class clusters
- Subject: Mutable classes and class clusters
- From: Rob Rix <email@hidden>
- Date: Sat, 15 Sep 2001 15:48:58 -0400
Hello, all.
After some checking through the archives, I wasn't able to find the
answers I wanted (*grin*), so I'm checking here now.
My questions:
1) What benefits do separate immutable and mutable classes provide? I'm
developing a framework, and I'm wondering whether I should separate the
mutable aspects of some of my classes into a mutable subclass.
It occurs to me that the rationale behind this decision might have been
the fact that NSArray et al are class clusters. Is this the case?
2) One of the classes I'm implementing in my framework is about to be
redesigned as a class cluster, with a single public class (unless I find
that separating it into mutable and immutable would be worthwhile, of
course). So, to make a class cluster, is all that is involved changing my
class' -(id)init method so that it returns an instance of a private
subclass? Should I also have said private subclasses report that they are
actually members of the superclass when queried with things like
-isMemberOfClass, -class, and +class?
Thanks very much,
-- Rob
If there's anything more important than my ego around, I want it caught
and shot now. - Zaphod