Working with the Model

Eclipse Modelling Framework (EMF)

The underlying model in Archi is implemented as an Ecore model in the Eclipse Modelling Framework. Using the EMF we are able to define Archi's meta-model and generate some of the model code. The model code that can be generated comprises the Java classes for the ArchiMate elements and relations, utilities and resources.

The model plug-in

The model plug-in is uk.ac.bolton.archimate.model. This plug-in contains the Ecore definition files in the model folder - the main Ecore file (archimate.ecore) and the Generation model (archimate.genmodel). The archimate.ecore file defines the classes and relationships that constitute the meta-model for the ArchiMate concepts and the visual elements used in the application.

Generating the model code

The model code is generated from the archimate.genmodel file. When this file is open in Eclipse, a new set of menu items is available under the "Generator" main menu. We only generate the model code, the other "generate" menu items are not used, as the Editor is written separately using GEF, SWT and JFace (the uk.ac.bolton.archimate.editor plugin). Note that in the generated files there is a significant amount of code that is not generated. This is code that adds functionality to some the model classes, and provides utility functions.

Extending the model

It is possible to extend the model by adding new model elements and relations, though it must be emphasised that this would mean that a special version of the application would have to be built and these additions would not be supported in regular versions of the application.

Example of extending the model with a new element

Example of extending the model with a new relationship