what is the use of Eclipse Modelling Frameowrk and Eclipse Graphical Editing Framework?

817 views Asked by At

May be this question is easy but it created me a bit of confusion with their purpose.

Just exploring the Eclipse Modelling Frameowrk and Eclipse Graphical Editing Framework. Basically The Graphical Editing Framework (GEF) provides a framework for creating visual editors. And The Eclipse Modeling Framework (EMF) is a Java framework and code generation facility for building tools and other applications based on a structured model.

Here I am little bit confused with what is the exact use and purpose of both the frameworks. Do I need to explore both the framework while developing any kind of UI?

1

There are 1 answers

0
s.d On

From a practical point-of-view:

  • The introductory text on the EMF website you quote is a bit misleading IMHO. Basically, EMF lets you create (data) models, not tools/applications (directly). For example, I am developing an Eclipse RCP application including a GEF editor which is based on a data model created (generated, then customized) by EMF.

  • GEF lets you create graphical editors. That's it. GEF editors can work on different kinds of models, amongst them EMF models. Have a look at the GEF book, where they use a plain Java model for their example application. In GEF, you have to manually code the editor.

  • To complete the acronym bingo, there is GMF, which lets you generate graphical editors from EMF models (as opposed to GEF where you have to do it on foot). GMF could be called the missing link between EMF (model) and GEF (graphical editor), but it isn't easy to get started with. An alternative to GMF is Graphiti, which provides a Java API for easily developing graphical editors based on EMF models.

And in answer to your comment: You cannot develop a model with GEF, you would have to use EMF for that. GEF builds on top of models (not just EMF models). It provides the V (View)* and C (Controller) in MVC, EMF can be used to provide the M (Model).

*Out of scope: GEF makes use of Draw2D as well for figures.