Skip to content

Listener Aspect¶ ⧉

This aspect allows the creation of listeners that can react to changes in the model. It can respond to different events, such as adding and removing children or value changes of properties.

How do you react to changes in the model?

Use com.mbeddr.mpsutil.modellisteners from the mbeddr platform ⧉.

Is there a way to listen to changes in any descendant?

Add a single change listener to BaseConcept ⧉. You must still define your logic for every type of change (property, reference, child) separately.

Are they executed synchronously or asynchronously?

They execute synchronously.

What are real-world examples of listeners?

  • update other nodes when children are removed or added
  • add missing references when the model changes
  • update components that preview nodes
  • remove cache entries when you remove a node
  • calculate IDs or updated calculated hashes when the model changes
  • populating the list of results when the specified scope of a node changes that fetches information from the model

Last update: November 7, 2023

Comments