Hi All,
I have a new proposal for the way that the notation providers can listen
to model changes (different from the way proposed in the latest cookbook).
This change is needed to
1. Simplify the Figs,
2. Since with different languages (UML, Java, C#,...) it may become
necessary to listen to different model change events.
3. Currently the knowledge of which modelelements and events are needed
to build a notation string is distributed over the Fig and the
NotationProvider.
The proposal:
1. The Fig listens to model change events as currently.
2. The Fig delegates the registering of events to the notation provider
by calling (in the initNotationProviders function):
NotationProvider4.registerListeners(PropertyChangelistener this);
3. When the model changes, and the Fig gets a PropertyChangeEvent, it
delegates the reaction on the event to the Notation provider as follows:
if (NotationProvider4.propertyChanged(PropertyChangeEvent pce)){
setText(notationProvider.toString());
}
Hence, the NotationProvider4 shall also have a method:
boolean propertyChanged(PropertyChangeEvent);
which returns true if the string needs updation, and false if not.
Please give your opinion about this architecture!
BTW: Is this not a known pattern?
Regards,
Michiel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]