What is the Eclipse Modeling Framework?

Sorry, this may seem too simple, but I'm unclear about what the Eclipse Modeling Framework is?

Based on its website, it generates Java code based on the XML specification.
Interestingly, is this something like Visual Paradigm? And does it generate code for other languages ​​(like PHP) or only for Java?

Thanks.

+6
source share
2 answers

EMF is a structure that can take a model (as described in the .ecore file) and create supporting Java files that can be used with EMF to create, load, manage, and save instances of this model.

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

There are many modeling projects, and they add support for increased functionality, but most of them are based on EMF.

+6
source

Basically, EMF is the foundation for developing model-based development tools (MDDs).

The tools that interest you are in the Model To Text (M2T) section. Using tools like JET , you can create logical business objects, not just DTOs, in whatever language you want. You can generate code from domain languages ​​(DSL), which you define yourself (usually in XML) or from standard modeling languages ​​( UML or Encore ).

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

Having tried several code generation tools, I can say that it was a useful experiment. However, this requires a significant investment, and you risk depending on one specific instrument. If you do not need a code generation tool, also think that you may have a language smell or it has not reorganized enough duplication.

+3
source

Source: https://habr.com/ru/post/890880/


All Articles