project background
 
 
 
 
 
 
 
 

Feature Tour 2: Model-driven Engineering

Model-driven engineering is currently a hot topic in the software industry. The main idea is to enable software engineers to create their own domain-specific languages and automatically generate executable code for one or more target platforms. It's all about creating higher abstraction layers and automation of software development.

Object persistency: the perfect basis for MDE

OOMEGA is not only covering model-driven engineering. One of its major strengths is an innovative object persistency solution, which is the perfect basis for model-driven engineering projects.

This leads automatically to a great set of features regarding MDE. For example you can design your metamodels with a well-defined object model, store your metamodels and models in a database and continue processing your models with the help of an object-oriented database API and a powerful query language.

OOMEGA's fundamental benefit is a solid basis, where e.g. the meta-metamodel is self-describing and (meta-)models might be naturally stored in a central database.

Back to top

Textual concrete syntax specification

Metamodels represent the abstract syntax. They are describing the structure of the information. In contrast one or more concrete syntaxes are used to create and manipulate models.

Please distinguish between generic concrete syntaxes which can be directly derived from the metamodel specification and individual concrete syntaxes. The latter have to be specified in addition and on-top of an already present metamodel.

OOMEGA supports both. There are not only elegant generic concrete syntaxes available out-of-the-box. You have the opportunity to specify one or more individual textual syntaxes, too. Thereby your metamodel does not loose its central role, i.e. it isn't replaced by an abstract syntax tree automatically derived from a grammar.

To state it in a couple of words: Metamodels first. Syntax follows.

Back to top

Modelling with domain-specific languages

The specification of an individual concrete syntax on-top of an already present metamodel leads to a domain-specific language.

You do not have to implement model editors. OOMEGA provides an open source Eclipse Editor plug-in for creating and manipulating models with domain-specific languages.

The individual syntax provides an intuitive way to create and manipulate models whereas the metamodel ensures well-structured information. Actually the information can be naturally stored in databases and is best suited for further computational processing.

Back to top

Manipulate models with Java Model Access API

As stated earlier - metamodels are class models. Models are objects. Objects can be created and manipulated with OOMEGA's Java Model Access API.

The Java API is powerful and elegant. Please convince yourself by studying the features regarding object persistency.

Moreover OOMEGA provides a generic way to write down objects naturally in the Java environment. Consider the following entity class:

@entity (cid = 1002) class Person
{
  @attribute @notnull String firstname;
  @attribute @notnull String lastname;
  @attribute Address birthPlace;
}

Then you can instantiate a Person object like this.

Person(
  firstname( "Christian" ),
  lastname( "Merenda" )
);

Please note that there's no new operator necessary. Besides during object instantiation you can decide which fields are immediately set. Do you recognize a similarity to XML?

Back to top

Exploit models with object-oriented query language

You can utilise OOMEGA's Java Model Access API alongside its model-based query language - e.g. in the context of template programming for the code generation engine.

Please note that the query engine supports predicates, i.e. the FROM and WHERE clauses, but also handles SELECT, GROUP BY, HAVING and ORDER BY statements.

All in all, another great feature to exploit and post-process your models.

Back to top

Store (meta-)models in a database

Metamodels and models can be stored in the very same data repository.

You may decide to store your models in a central database, e.g. Versant Object Database. You could also utilise OOMEGA's MemoryDB. You might start with our in-memory database and switch to Versant in a production environment - with no effort as every persistency layer is encapsulated with exactly the same API. It's really your choice!

It's great that you can count on OOMEGA's database support. In practice, when your models grow and grow, databases are the perfect candidate to handle large data volumes, aren't they?

Especially object databases can provide key benefits: object navigation, which is tremendously utilised in the context of MDE, is then as fast as it can be.

Back to top

Model-to-model transformation with ATL

ATLAS Transformation Language (ATL) is a prominent open source project that provides a model-to-model transformation language and an interpreter for it.

Thanks to the good working relationship to the ATL team member Frédéric Joualt and his support we could implement an OOMEGA-specific virtual machine for ATL. Now you can execute model-to-model transformations with OOMEGA and ATL.

Back to top

Code generation with JSP or Xpand

There's a built-in code generation engine available: OOMEGA Generator. It is based on Java Server Pages (JSP) technology, which is a well-known and widely-used template language.

Alternatively you are welcome to use openArchitectureWare (oAW). OOMEGA is well integrated with oAW and provides a demo for this purpose.

OOMEGA's Java Model Access API and query language is used to explore models in the context of JSP or Xpand templates. Hence, whatever code generator you prefer, it will provide more features than simple template processing.

Back to top

Automated build processes

Fully automated build processes are essential in modern software engineering projects. This is even more important in the context of model-driven engineering.

Model transformators and code generators are delivered with predefined tasks for Apache Ant. Moreover there are Maven Mojos provided. Hence you can naturally integrate model transformation processes in your Maven or Ant build scripts.

<jgen templatepath="build/temp/classes">
  <template name="automaton.java" />
  <model file="TrafficLight.sdf" />
  <dest dir="build/output/traffic-light" />
</jgen>

The previous example shows the jgen Ant task in action. This time the binary-coded model file TrafficLight.sdf contains the model information. But it could be a model database as well.

Back to top

Best code generation performance

Code generation is an integral part of nearly every build process. Therefore it should be very fast!

Our code generator's performance is very good. Have you ever spent too much time for long-lasting build processes? We did. In the past.

Back to top

Eclipse integration

OOMEGA provides an open source Eclipse Editor plug-in for creating and manipulating models with domain-specific languages.

But this is only one example. In fact, OOMEGA delivers a rich set of Eclipse plug-ins. Hence, you do not have to dispense with OOMEGA's rich feature set in return of a good Eclipse integration.

Back to top