Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Eclipse Modeling Framework?

I am sorry, this might look too simple, but I am vague about what Eclipse Modeling Framework is?

Based on their website, it generates java code, based on XML specification.
I wonder if it is something like Visual Paradigm? And does it generate code for other languages (such as PHP) or just for Java?

Thanks.

like image 556
Omid Kamangar Avatar asked Jun 19 '11 22:06

Omid Kamangar


2 Answers

EMF is a framework that can take a model (as described in a .ecore file) and generate the supporting Java files that can be used with EMF to build, load, manipulate and save instances of that model.

That means you use EMF when you are writing a Java application and want to manipulate a model (an abstract syntax tree for a language, a model that can be displayed by your View, a domain that needs to be manipulated, etc).

There are a lot of modeling projects, and they add support for more and more functionality but most of it is based on EMF.

like image 80
Paul Webster Avatar answered Nov 10 '22 16:11

Paul Webster


Basically, EMF is a framework for developing model driven development (MDD) tools.

The tools you will be interested in are in the Model To Text (M2T) section. Using tools like JET you can generate logic-containing business objects, not just simple DTOs, in any language you want. You can generate code from domain-specific languages (DSL) that you define yourself (usually in XML) or from standard modeling languages (UML or Encore).

When you have picked a modeling language, there are ways to build your models using graphical tools (GMF). In addition, EMF has the validation/translation tools you would expect.

Having tried out several of the code generation tools, I can say that it was a worthwhile experiment. However, it requires a significant investment to learn and puts you at risk of depending on one particular tool. If you find yourself in want of a code generation tool, also consider that you may have a language smell or haven't refactored out enough duplication.

like image 27
Garrett Hall Avatar answered Nov 10 '22 15:11

Garrett Hall