I will try to create an appropriate description but I
don't really
know
where to subclass as it is a bit of a mix between a
SingleOptionDescription with instances of a class as option and a
ToOneRelation description with class Person. What do you think ?
Yes, those two already duplicate some code, traits would be of a big
help here ;-)
Anyway, I would subclass the ToOneRelation and try to copy the things
you need from the SingleOptionDescription (probably only #options)
over into your new class. The same for the views.
that makes me ask another question... Are all
MADynamicObject used
with
classes or subclasses as it is in my image ?
No, that should work with any block of code. However MADynamicObject
does not work together with the Smalltalk Debugger, as the debugger
tries to evaluate the block again when displaying the object in its
inspector causing yet another error and debugger ...
So one thing you have to make sure beforehand is that the code in
MADynamicObject works as expected by copying the contents of the
block to a workspace and testing it there.
I tend to discourage the use of MADynamicObject because it usually
causes more troubles than it solves. It is much a better approach to
create your descriptions dynamically on the instance side, if you
need to build them depending on the state of your model.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch