To build a metadescription of an object Magritte per
default only
looks a the class side. It collects all the selectors the class of the
object contains that begin with 'description' and performs them. This
can take a moment on Squeak so a cache was added that maps classes to
metadescriptions. This cache will have to be invalidated if a class is
changed (a method added or removed).
The cache is only useful if you need to traverse a collection of
thousands of objects that mostly share the same descriptions. Like
this, descriptions don't need to be recreated all the time. This
significantly speeds up the traversal.
PS: looking at the squeak implementation it seems
that MADescriptionBuilder
flushes its cache of description if any method is changed or modified or
added in the entire System, not necessrily an object in the
MADescriptionBuilder cache
This is the simplest thing that reliably works. It could be that you
call other methods from the code that builds the descriptions (for
example, if you extract default values to separate methods), that
could affect the settings of the descriptions. In a productive system
the cache fills up pretty fast. Since code changes in a productive
system are rare this is not an issue.
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch