[Magritte] Description properties

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Magritte] Description properties

Damien Cassou-3
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


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki