This tutorial aims to show how to directly call the richFoo and they operations without going through the @main operations. (usefull for example for fine grain UI integration with aspectized code). This is a variant of the tutorial Chapter 2, Calling Kermeta main operations from a standalone Java program but instead of relying on the generated runner classes, the user directly call the kermeta classes and operations. Then, depending on the origin of the classes, these classes can then be used either with a pure EMF point of view (ie. only using the EMF generated code) or might be manipulated as Kermeta (ie. using the aspect). This requires some understanding of the architecture of the generated code.
TODO explain and illustrate
This tutorial will detail the following points:
Create a new Kermeta project
Declare some classes and some operations
Generate a basic jar file from the Kermeta project (using a simplified pom.xml)
Create a new Java project that depends or embedds the jar of the kermeta project
In the java code, call the initialization of the kermeta code
create some object from Kermeta classes and call operation on it it.
In the Kermeta project, add an ecore model with some operation
By aspect, add some behavior to the operation.
In the java code, in pure EMF style, load a model conforming to this ecore.
Call kermeta aspect operation by using exclusively the EMF api.
Execute the java program as a standalone application