Java Reference
In-Depth Information
COMMENT
The notation model is similar in its purpose to the Object Management
Group's (OMG's) Diagram Interchange (DI) specification, which was devel-
oped to facilitate diagram exchange between Unified Modeling Language
(UML) modeling tools; XML Metadata Interchange (XMI) for UML allows
for the exchange of the model itself.With the introduction of the GMF run-
time model into Eclipse, discussions have taken place regarding the update
of the DI specification to align it with the GMF runtime model.
10.3 Extensibility Mechanisms
As you saw in Chapter 9, building a GEF editor means writing Java code that
extends provided abstract classes and implementing required interfaces. GEF
provides some integration with the Eclipse platform, but it offers no extension-
points and limited hooks for extension. Furthermore, GEF does not require a
clean separation of domain and notation information, although you can imple-
ment your graphical editor in this manner. In short, although GEF is a light-
weight framework that is relatively easy to work with using conventional coding
techniques, the GMF runtime provides a much richer set of extensibility frame-
works and mechanisms that are specifically designed for building graphical edi-
tors for EMF models. As mentioned earlier, this comes at the price of some
additional complexity (the usual trade-off).
As covered in Chapter 9, the main extensibility point of GEF comes with
providing your own EditPartFactory , which the Viewer maintains to create
EditPart s, which create EditPolicies. With GMF, EditPart s creation is modi-
fied to include a call to a service, where providers are registered and effectively
replace the EditPartFactory concept in GEF. In fact, most aspects of diagram
functionality are wrapped in services, including EditPolicies, views, palette, and
layout. Section 10.4, “Services,” covers the Service layer, along with detail on
each of the provided services.
Although the extensibility of the GMF runtime is beneficial, it comes with
the danger of malicious or malformed extensions that can be contributed to your
diagram and can break its functionality. Also note that the current diagram code
generated with the GMF tooling provides for normal runtime extensibility in a
somewhat limited fashion. Not all extension-points are used because the team
that wrote the tooling and generator did not see the value in contributing to each.
However, the generation tooling is itself flexible, so if you want to alter the
 
 
Search WWH ::




Custom Search