Hi all,
I have a situation that brings up a couple of questions.
I have 2 classes which have a class side variable which keeps track of
the instances created (much like how Pier's PRKernel works). As a
consequence, I need these objects to be instantiated, not with #new,
but with a special message (e.g. #named:).
The second part of the equation is that, while these two classes have
their own Magritte definitions and can display themselves, there is a
"main site" component that displays all the instances from these two
classes, as options for the user. So this puts me in a situation
where the main site class needs to have descriptions
(MAToManyDescription I believe) that reference the other two objects
(i.e. the main site class wont have any instVars for these). And for
added fun, this class has a class side method named #description for
the Seaside framework.
Now, I think the issue with the main site is not so bad, I would just
define my #description methods as normal, right? Since #description
is taken already I guess I have to override it on the instance side
and call MANamedBuilder for: myself?
And the other question is, how do I enforce that when Magritte wants
to make a new instance of these other two classes that it uses my
custom constructor, not #new? Since the custom constructor is going
to expect a portion of the data already, I'm guessing I need some kind
of Memento? I suppose I could just let it create the object with new,
and then have the accessor create the "real" object from this, but
that seems very cheesy.
Thanks for any help you can provide,
Jason