Background
Frankly speaking, using the graphical Editor Framework (GEF) to create graphical editors in Eclipse was slow and painful in the past. This process involves understanding complex frameworks and a large number of redundant code. But it also shows that GEF is the best framework to create a graphical editor, because it has nothing to do with the model. On the other hand, there are some problems with model-independent itself.
A GMF of the gossip
GMF's run-time component is IBM® for use with Eclipse Foundation, which was previously supported by IBM rational® modeling products.
GEF is the essence of the Model-view-controller (MVC) mechanism, which allows you to introduce your own model into the table. In the early days of using GEF, most people also used custom models (consider traditional Java objects [Plain old Java™object, POJO]). You will find that the problem with your custom model is that you need to write your own generic code to support the model, such as serialization and listening for model changes.
The next logical step in using the model in GEF is to use the Eclipse Modeling Framework (EMF), which provides the tools to serialize the model in various forms and the ability to listen for changes to the default values of the model.
However, integrating the EMF model with the GEF framework has some technical difficulty (such as different command stacks), leading to the EMF model not being accepted quickly by the GEF based editor. Eventually, the GMF project came into being in this adversity and wanted to introduce a quick way to generate graphical editors. In a similar way, EMF generates a basic editor for the EMF model.
Creating an EMF Model
The first step in creating a model is to define the collaboration object for the EMF model. The purpose of my writing this article is simply to illustrate the process of defining the model, not to delve into the usage of the model-processing tools that EMF provides. The model to be used in this example is a simple graphical model. I'll use a diagram to help me explain how the model looks.
Figure 1. A visual graphical model