Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gemoc-dev] link between aspects and eObjects

Hi

in K3 aspect instances are hidden, everything is available throught the static methods applied to the EObject itself. The static method takes care to retreive or create the "companion" object and call the code using its data.

the link set by Fabien works using java invoke but you can can directly the aspects in pure java

if you look at http://diverse-project.github.io/k3/publish/user_documentation/html_single/user_documentation.html#_k3_active_annotations_compilation_example
it creates an aspect on java class "File" (but in GEMOC we use it to add aspects on java classes generated from the ecore mm; but it works the same)

in the example the line :
val f = new File("toto.txt")
    f.contentType = "txt"

is possible thanks to the import static extension ....*
but actually means(in xtend)
val f = new File("toto.txt")
    SampleXMLFileAspect.contentType(f, "txt")
which is exactly the same in java (just add ; and correct variable declaration ;-) )

this also works for methods defined in the aspect using a form similar to :

MyClassAsspect.myMethod(aspectizedObject, optionalothermethoparameters);


I think this would be safer to use since it adds static typing to your code :-)

cheers
Didier

Le 20/06/2018 à 10:13, Julien DeAntoni a écrit :
Thanks Fabien. I already tried with this helper, from which I can retrieve the Aspect classes, however I'm not able to retrieve the instances of these aspects classes, that are used by the (one of) execution engine...
I tried to check the debugger perspective but it does not work for the concurrent engine, yet.

any other pointers ?


On 06/20/2018 09:50 AM, fcoulon wrote:
Very quick answer:

https://github.com/eclipse/gemoc-studio-modeldebugging/blob/master/framework/execution_framework/plugins/org.eclipse.gemoc.executionframework.engine/src/org/eclipse/gemoc/executionframework/engine/commons/K3DslHelper.java

Another lead is to look at the Variable view in the debugger perspective (it should be filled with attributes from Aspects)

Fabien

Le 2018-06-20 08:54, Julien DeAntoni a écrit :
Hello,

I'm developing a concurrent language (actually working on the gemoc
sigpml language). I'm using pure k3 to define the rewriting rules (no
Melange).

The execution worked fine. Now I want to customize the sirius odesign
to add an animation layer where runtime data (data defined in k3) can
be displayed.

I plan to use a java service to retrieve the data.

What is the entry point for that ? What class is supposed to provide
access to aspects from eObjects ?

thanks

julien


-- 
Julien Deantoni
Associate Professor
I3S Lab - UMR 7271 -KAIROS
INRIA Sophia Antipolis Méditerranée
2004 rte des Lucioles (Lagrange L-041)
BP93, F-06902 Sophia Antipolis Cedex, France
tel: +334 92 38 77 66
http://www.i3s.unice.fr/~deantoni/

_______________________________________________
gemoc-dev mailing list
gemoc-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/gemoc-dev
_______________________________________________
gemoc-dev mailing list
gemoc-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/gemoc-dev



-- 
Didier Vojtisek
SED Rennes - DiverSE Team
Univ Rennes, Inria, CNRS, IRISA
Campus de beaulieu
35042 Rennes
02 99 84 75 07

Back to the top