Summary
The Eclipse Graphical Modeling Framework (GMF) provides a set of tools to create graphical editors for any business domain. Such editors can then be used in Eclipse for code generation. Jeff Richley's recent article on GMF shows where a graphical editor can be an effective tool.
Advertisement
Domain-specific languages are very popular, but using them mostly involves writing code in the DSL. While more effective than a general-purpose language, in some problem domains it is useful to go beyond a DSL and create a graphical editor to interact with domain objects.
Graphical editors are especially useful when visualization of the domain objects can provide insight, as in the case of database structures, workflows, but even with regular business domain objects. The graphical editor allows visual manipulation of domain data, and can generate source code in a target language.
The Eclipse Graphical Modeling Framework (GMF) is designed to make building such graphical editors easy for any domain model that can be represented via the Eclipse Modeling Framework (EMF). That includes practically any type of structured data.
In a recent OnJava article, GMF: Beyond the Wizards, Jeff Richley provides an introductory tutorial on GMF. Richley introduces GMF as,
A framework that takes a set of configuration files (a domain model, a graphical definition, and a tool definition), puts them all in a blender, and **poof - magic** out comes a professional looking Eclipse plug-in. Not only does it generate most of the functionality that you have designed, it also gives many freebies such as printing, drag-and-drop, save to image, and customization... GMF ... will do most of the repetitive, error-prone work, as well as give you many advanced features.
The rest of the article walks through a simple domain model, and shows how GMF can generate code from a visual model diagram:
The domain model, ecore/genmodel files, is the starting place for development of most Eclipse-based applications. The basic development pattern for EMF is to model your domain objects and have EMF generate your entire model code base, including beans and glue code.
The article uses a fairly simple use-case to illustrate GMF. Where do you think such visual model-driven editors can be helpful?
> I get a server error when following that link. Seems that > it's pointing at page that doesn't exist. I believe the > proper URL should be: > http://www.onjava.com/pub/a/onjava/2007/07/11/gmf-beyond-th > e-wizards.html. Thanks for noting it, we corrected this.
Technical information Hi, I am a student in Computer Engineering of the university of the Sannio (Benevento - Italy) and I am working for the creation of a graphic editor in GMF for metamodelli Uwa.
I would like to kindly know as the generalizations of a metamodello UWA they are managed with GMF. In reality I don't succeed in understanding whether to plan the generalizations. Aspect your answer!! Thanks and good job!!