Hi,
adding properties to descriptions is a simple but long work. You need to:
- add a boolean description (class side)
- add a default method (class side)
- write accessors (instance side)
- write action methods starting like 'beSorted' (instance side)
- write testing methods (instance side)
When looking at accessors:
MAToManyDescription>>ordered
^ self propertyAt: #ordered ifAbsent: [ self class defaultOrdered ]
it seems to me it was just a DictionaryAccessor after all. So I tried to
use this.
- I implemented #at: and #at:put: in MAObject (that were just calling
#propertyAt: and #propertyAt:put).
- I wrote a new constructor in MADescription:
#dictionaryKey:label:default:priority:)
- I replaced some properties descriptions by a call to the new constructor.
All the tests still worked (not sure any line of what I changed were
called during the tests).
But then, I didn't know how to replace all the methods that need to be
written.
Do you have any idea?
--
Damien Cassou