Errata:
Where it says: MyModel>>#magritteDescriptionOfInstances
It should say: MyModel class>>#magritteDescriptionOfInstances
:)
Esteban A. Maringolo
2014-02-27 19:46 GMT-03:00 Esteban A. Maringolo <emaringolo(a)gmail.com>om>:
I know all the advantages of having the descriptions
defined in the
instance side. But I find one drawback.
Let's suppose I want to implement a tool that works at meta level, and
I want a list of the available descriptions of a class in order to
build a query where each description will map to a column.
Is there any way I can obtain all the instance side descriptors
without having to instantiate my object?
MyModel has
#descriptionA
#descriptionB
#descriptionC
I want something like: MyModel>>#magritteDescriptionOfInstances and
get the above mentioned descriptions.
I know some descriptions will need specific instance variables in
order to work, I would like also to categorize/filter those
descriptions that are "class side friendly" (it is, they don't require
instance specific behavior).
Otherwise I don't see other option than to partition the descriptors
to both instance and class side.
E.g.:
MyModel>>#descriptionA
<magritteDescription>
^self class descriptionA
MyModel class>>#descriptionA
<magritteDescription>
^MAStringDescription new...
Any clues?
Esteban A. Maringolo