if an Object holds a collection of other Objects (like
a group of
Persons), and
these (Persons) should not be created/edited but a list to choose
from should be
presented - would a MAMultipleOptionDescription be appropriate? If
so, how can
the options presented be made dynamic.
There are several ways to make properties of descriptions dynamic.
1. Override #description on the instance-side and build your
descriptions programmatically. Don't forget to copy the descriptions,
in case you call super to get modify the default behavior.
2. Pass the property a block that you send #asDynamicObject. See the
senders of this message for examples. This approach is simple and
works in most cases, there are some possible drawbacks however: (1)
the implementation uses a proxy object that might not get properly
resolved in all cases, (2) the proxy object references a block context
that might not be serializeable with your preferred persistency
mechanism, (3) proxies are hard to debug, and (4) from within the
block you don't have access to the described object.
PS: I started a Magritte FAQ at
http://www.lukas-renggli.ch/smalltalk/magritte/faq
.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch