Skip to content
Timur Sağlam edited this page Dec 26, 2016 · 60 revisions

Basic Use

The project can be used in two different ways. One can use the project as an Eclipse Plugin through the MainHandler class, or address directly the main class EcoreMetamodelExtraction.

  1. When using it as a plugin, a simple dialog allows choosing a Java project which is then used to extract a metamodel. The metamodel is saved with the saving strategy specified in the properties file.

  2. When working with the class EcoreMetamodelExtraction directly, it offers three simple methods to work with. The method getProperties() grants access to the instance of the class ExtractionProperties, which allows to configure the extraction process programmatically. This can also be done through editing the properties file before running the program. With the methods extractFrom() and extractAndSaveFrom() the metamodel extraction is started for a given IProject.

General Architecture

Even though the EcoreMetamodelExtraction consists out of seven packages, the general architecture can be broken down to three parts: The project parser, the intermediate model and the metamodel generator. The parser analyzes a Java project using the JDT API and extracts all the information the implicit model of the Java code contains. With these information the parser then builds an intermediate model. The generator then uses the intermediate model to build an Ecore metamodel. The Ecore metamodel is build as a tree structure out of EObjects, with a root package as container of all the elements of the metamodel. The generator also has the ability to save the generated Ecore metamodel as an Ecore file. For this process, there are several different saving strategies available.

Package structure

The projects main package eme contains five subpackages: parser, model, generator, properties and handler. The packages parser, model and generator contain the three key components which were explained before. The properties package contains the classes for the managment of the properties file. The properties file can be loaded, accessed, changed and saved with the classes of the package. Additionaly the architecture enables the creation of additional properties file managers to use additional properties files. The package handler contains the main handler, which allows using the project as an plugin for the Eclipse IDE and offers a simple dialog for choosing an input project.

To understand the different parts of the project, see the following pages:

  1. Intermediate Model

  2. Java Project Parser

  3. Ecore Metamodel Generator

  4. Saving Strategies

  5. Extraction Properties

Clone this wiki locally