2007/1/8, Ramon Leon <ramon.leon(a)allresnet.com>om>:
Then you can
put your descriptions in a method like:
Address class>>street
<description>
^ MAStringDescription selector: #street
Cheers,
Lukas
Oh... You're just trying to avoid the description naming pattern, I see. I
was thinking something more along the lines of something on the accessors
directly...
Post>>author
<description: #SingleOption label: 'Author'>
<options: #findAuthors>
<relatedTo: #SBAuthor>
<displayField: #asString>
<required: true>
^author
Post>>comments
<description: #ToManyRelation label: 'Comments'>
<relatedTo: #Comment>
^comments
Post>>title
<description: #String label: 'Title'>
<required: true>
<length: 150>
^title
Post>>body
<description: #Memo label: 'Body'>
<required: true>
^body
Post>>isPublished
<description: #Boolean label: 'Published?'>
<default: true>
^isPublished
This has one problem: sends do not work and neither do classes. As an
example the following can not be converted to this style:
- PRAddCommand >> #descriptionType
- PRCommandsWidget >> #descriptionCommandClasses
Philippe
And generating Magritte descriptions from the metadata
and not using class
side descriptions at all. Or maybe just by default, and falling back on
class side descriptions for complex cases.