I do not have the answer just meat questions:
Will we have the declare new pragmas each time you add a new
property to a description.
Pragmas in Squeak do not need to be declared, but I would not use
them like suggested.
>> Post>>author
>> <description: #SingleOption label: 'Author'>
>> <options: #findAuthors>
>> <relatedTo: #SBAuthor>
>> <displayField: #asString>
>> <required: true>
>>
>> ^author
In my opinion pragmas should not be used to write code, but to tag
and configure code. I would suggest something like that:
Post>>author
<description: #authorDescription>
^ author
What tells Magritte to look at #authorDescription to get a
description for #author:
Post>>authorDescription
^ MASingleOption new
options: self findAuthors;
relatedTo: SBAuthor;
beRequired;
yourself
Note that there is no need anymore to define an accessor, as this
will be figured out automatically by Magritte.
Do we really want that? what are the benefits? over
class side
single description?
The problem with class side descriptions is that they cannot adapt
themselves to the state of the object. Something that currently
enforces to override #description and to manually patch the
descriptions.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch