Am 05.08.2015 um 10:58 schrieb Iwan Vosloo <iwan@reahl.org>:

On 05/08/2015 10:38, Norbert Hartl wrote:

Am 05.08.2015 um 09:15 schrieb Iwan Vosloo <iwan@reahl.org>:

Hi,

Can someone perhaps explain what is meant by descriptions being dynamic in Magritte 3? I see some references to this change on the web, but do not fully understand it. From what I understand Magritte 2 used to cache them somewhere, and this is not done anymore. I'd like to know where this caching used to be done and what is now different as a result in Magritte 3.

In Magritte 2 descriptions are on the class side. So they are the same for every instance of that class. If I remember correctly the MAPragmaBuilder built and cached the descriptions for a class. In Magritte 3 the descriptions moved to instance side. This enables the powers of having descriptions individually for a single instance but it makes caching a task that is not possible. A single description can be different over time when an instance changes state etc.


Thanks, Norbert. I get that, but when you do, for example:

aComponent := anObject asComponent.

then aComponent holds onto the description created above (in asComponent's implementation), as I understand it.
This means that as long as aComponent exists, it will always refer to the same description.

Is that understanding correct?

I think that is correct. I don't use magritte much lately so my memory is slightly blurry. I need to give a more precise answer to the instance side description. A description can alter in two ways. Either the shape/class of the description changes when accessed multiple times. I think this is a not so likely thing to happen. The other way would be if the data in the description changes because the object changed. So a multiple option description can update the list of options while the descriptions stay the same. And that is one thing you gain with Magritte3 because you can have descriptions with dynamic data that has access to the instance.

Norbert