Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "ATL/Model Handlers"

< ATL
(Creating New Model Handler Drivers)
(Creating New Model Handler Drivers)
Line 19: Line 19:
 
* Extend [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMModelElement.java?rev=HEAD&content-type=text/vnd.viewcvs-markup ASMModelElement] to implement specific model-element-level behavior. There are already two examples: [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.emf4atl/src/org/atl/engine/repositories/emf4atl/ASMEMFModelElement.java?rev=HEAD&content-type=text/vnd.viewcvs-markup ASMEMFModelElement] and [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.mdr4atl/src/org/atl/engine/repositories/mdr4atl/ASMMDRModelElement.java?rev=HEAD&content-type=text/vnd.viewcvs-markup ASMMDRModelElement].
 
* Extend [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.vm/src/org/atl/engine/vm/nativelib/ASMModelElement.java?rev=HEAD&content-type=text/vnd.viewcvs-markup ASMModelElement] to implement specific model-element-level behavior. There are already two examples: [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.emf4atl/src/org/atl/engine/repositories/emf4atl/ASMEMFModelElement.java?rev=HEAD&content-type=text/vnd.viewcvs-markup ASMEMFModelElement] and [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.mdr4atl/src/org/atl/engine/repositories/mdr4atl/ASMMDRModelElement.java?rev=HEAD&content-type=text/vnd.viewcvs-markup ASMMDRModelElement].
 
* Extend [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.eclipse.engine/src/org/atl/eclipse/engine/AtlModelHandler.java?rev=HEAD&content-type=text/vnd.viewcvs-markup AtlModelHandler] to implement model loading and saving. There are already two examples: [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.eclipse.engine/src/org/atl/eclipse/engine/AtlEMFModelHandler.java?rev=HEAD&content-type=text/vnd.viewcvs-markup AtlEMFModelHandler] and [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.mdr4atl/src/org/atl/engine/repositories/mdr4atl/AtlMDRModelHandler.java?rev=HEAD&content-type=text/vnd.viewcvs-markup AtlMDRModelHandler].
 
* Extend [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.eclipse.engine/src/org/atl/eclipse/engine/AtlModelHandler.java?rev=HEAD&content-type=text/vnd.viewcvs-markup AtlModelHandler] to implement model loading and saving. There are already two examples: [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.eclipse.engine/src/org/atl/eclipse/engine/AtlEMFModelHandler.java?rev=HEAD&content-type=text/vnd.viewcvs-markup AtlEMFModelHandler] and [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.mdr4atl/src/org/atl/engine/repositories/mdr4atl/AtlMDRModelHandler.java?rev=HEAD&content-type=text/vnd.viewcvs-markup AtlMDRModelHandler].
* Use the <code>org.atl.eclipse.engine.modelhandler</code> extension point in your plugin.xml to register your model handler driver. There is already one example: [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.mdr4atl/plugin.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup mdr4atl plugin.xml]
+
* Use the <code>org.atl.eclipse.engine.modelhandler</code> extension in your plugin.xml to register your model handler driver. There is already one example: [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.mdr4atl/plugin.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup mdr4atl plugin.xml]
  
 
ATL Development Tools strongly depend on [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.emf4atl/ emf4atl], which is consequently built into it.
 
ATL Development Tools strongly depend on [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/ATL/org.atl.engine.repositories.emf4atl/ emf4atl], which is consequently built into it.

Revision as of 09:09, 13 June 2006

In ATL engine terminology, a model handler is a library providing primitives for handling models:

  • Creating new models,
  • Loading and saving models,
  • Adding and deleting elements,
  • Reading and writing element properties.

A model handler driver is a piece of Java code making it possible to use the corresponding model handler with the ATL Virtual Machine.

The current version of ATL Virtual Machine provides two model handler drivers:

Creating New Model Handler Drivers

Here is a brief description of the work to be done:

ATL Development Tools strongly depend on emf4atl, which is consequently built into it. mdr4atl should rather be used as an example for properly placing Java classes and plugin.xml elements.

When to Create a New Model Handler Driver

In theory, there should be a distinct model handler driver for each model handler, independently of the metamodel that is used. For instance, there is one for Eclipse/EMF and one for Netbeans/MDR.

In practice, there are exceptions. For instance, the Eclipse/UML2 plugin implements the UML 2.0 metamodel by using EMF. However, it seems that UML2 models created with this plugin cannot be handled by EMF without the additional Java code available in the Eclipse/UML2 plugin (see ATL_Language_Troubleshooter#UML2_Profiles and this thread). This means that the UML2 metamodel that is implemented does not strictly follows EMF rules but adds its own rules. One example is profile and stereotype application: the profile must be applied before the stereotype. Such an ordering constraint is beyond EMF semantics. For this reason, full support for the Eclipse/UML2 plugin can only be properly achieved by adding code specific to this plugin in the model handler driver. Instead of doing this in emf4atl, which is metamodel-independant, a uml24atl model handler driver could be developed.

Back to the top