Saturday 10 September 2011

Designing Model Driven Architectures using the Eclipse Modelling Framework

The Eclipse Modelling Framework (EMF) is another useful tool within the Eclipse suite that offers an open source framework for the designing model driven applications. In terms of technology, EMF unifies Java, XML and UML. Given a 'model' described in either of the three technologies i.e Java, UML or XML schema, it is possible to generate the other two. To get an idea of what type of applications can be designed using the EMF, check out this list

The major advantage of using EMF is that it connects a model to its Java based implementation and this simplifies the process of designing and implementing a model. EMF generates Java code separating interfaces from their implementation. In addition, it also generates Factory classes for managing objects. EMF also supports standard CRUD operations, specification of cardinality constraints and the enforcement of referential integrity. Database persistence is available via Teneo.

Designing models in EMF is done using the Eclipse Java Development Tools.Third party options such as Topcase's Ecore editor and Ormondo's EclipseUML editors can also get the job done.
While the Ecore model can realised from Java (using Annotations) , XML Schema orUML, persisting the serializable version requires another form : XML Metadata Interchange (XMI).

Lars Vogel's tutorial is a good starting point for learning and implementing an EMF based application. While the learning curve for EMF is not very steep, debugging problems in the generated code can be a little painful. To get started with the development of EMF based applications, download the Eclipse Modelling Tools IDE and create a new EMF project using File -> New -> Project

No comments: