Like adding the contracts seen on the previous chapter, some dynamic semantics can be added to our metamodel through Kermeta aspect weaving. According to the dynamic behave that we want to express, we weave aspect operation inside each element of the metamodel where there is an action to express (i.e.: add methods that represent the action that you want for that element).
To do so you have to define a virtual machine (VM) representing the application domain where you'are going to weave your methods.
If needed, you can implement a Kermeta wrapper to another language or library to add missing feature to your VM (For example, you can call Java.lang.Math to perform calculation or Java AWT for drawing).
Note | |
---|---|
A complete example is given inside :
|