The Eclipse Graphical Editing Framework (GEF) Paperback – Aug 7 2011
|New from||Used from|
No Kindle device required. Download one of the Free Kindle apps to start reading Kindle books on your smartphone, tablet, and computer.
To get the free app, enter your mobile phone number.
About the Author
Dan Rubel, Senior Software Engineer at Google, is an entrepreneur and an expert in the design and application of object technologies. He has architected and managed several successful commercial products, and was cofounder and CTO of Instantiations, which was acquired by Google.
Jaime Wren, a software engineer at Google, has extensive experience developing commercial Eclipse-based tools. At Instantiations, he made significant contributions to the CodePro and WindowBuilder product lines. He continues to work on WindowBuilder as a member of the Google Web Toolkit (GWT) team.
Eric Clayberg, Software Engineering Manager for Google, is a seasoned software technologist, product developer, entrepreneur, and manager, with extensive Java and Eclipse experience. The primary author and architect of more than a dozen commercial Java and Smalltalk add-on products, he cofounded both ObjectShare and Instantiations.
Most Helpful Customer Reviews on Amazon.com (beta)
The book is written as a tutorial that develops a genealogy editor. In the first part about Draw2D, the authors do a great job in starting with a minimal solution and refactoring it as they add more features. This part is well written and easy to follow. Also, whenever a new Draw2D feature is introduced, the authors describe the various capabilities of Draw2D (e.g. the existing layouts, figures, anchor types, etc.). However, Draw2D is the easy-to-understand part of GEF, and most developers won't need a book to get started.
After Draw2D, the authors describe Zest, which is an extension to GEF that offers JFace-like viewers. I have skipped this part, because I am interested in editors, not viewers.
When it comes to GEF, the authors almost give up at explaining. They mostly describe their code as if observed through a debugger, without drawing the conceptual lines between the invocations. You will find sentences like this (p. 236): "When the user selects an element, the layout EditPolicy [...] for that element's container is found and the createChildEditPolicy(...) method is called." The book does not mention or explain any of the following:
(1) what EditPolicies have to do with layout
(2) when and why EditPolicies are looked up
(3) what a ChildEditPolicy is and why it is needed
(4) why an EditPolicy creates another EditPolicy when it usually creates Commands
After reading the book, I am left with the impression that the authors barely managed to implement the example editor themselves. Also, I cannot imagine that they were involved in the development of the (quite sophisticated) graphical editor that is part of WindowBuilder(tm) of their company Instantiations (acquired by Google). In fact, the editor was originally developed by Konstantin Scheglov and then bought by Instantiations. Konstantin Scheglov continues to be the chief architect and technical lead after WindowBuilder was donated by Google to the Eclipse foundation.
=== What is good ===
- concise wording; no repetitions
- easy to follow in the Draw2D part (and maybe the Zest part)
- starts with a minimal implementation and refactors it as new features are introduced
- develops a single example editor throughout the book
- nicely describes zooming and how to do pixel-perfect rendering at zoom levels > 100%
- nicely describes the difference between composing figures of other figures and implementing your own rendering
- nicely describes layers and scrolling
- describes how selection feedback can be customized
=== What is bad ===
- does not explain how GEF works
- only 267 pages (including index), not 312
- the index is a fake; mostly class and method names
- the References section at the end of each chapter almost always refers to the same resources
=== What is missing ===
Regarding GEF, this book can be better characterized by what is missing than by what is not. It does not cover any of the following topics:
- how event handling works in GEF (different from Draw2D)
- how Tools and Requests work (two of the most central things in GEF)
- the different states an editor can be in
- how to use GEF's default layers and how to add your own
- does not explain an EditPart's life cycle
- does not explain an EditPart's activate/deactivate methods
- how drag-and-drop works and what a DragTracker is
- showing temporary/auxiliary elements (e.g. guide lines)
- showing a grid
- showing rulers
- implementing snap (e.g. snap to grid, guides, or figures)
- how feedback works and how to implement custom feedback
- should have listed Requests created by the various Tools
- how to use the command stack
There are no advanced topics or goodies, like e.g.
- animating figures
- using text figures (TextFlow etc.)
- customizing the keyboard behavior
- performance and memory considerations; scaling; visualizing huge numbers of elements/figures
- whether lazy EditPart creation is possible
- doing complex custom layouts
- dynamically adapting the rendering (e.g. showing more or less details depending on the zoom level)
- implementing non-scrollable (fixed) figures
Here is my view of what the book should have explained:
A graphical editor interacts with the user and must therefore interpret mouse and keyboard events. Besides rendering, this is the core of a graphical editor. In GEF, most of the event processing is done by Tools; a Tool in GEF is not a button on a button bar. The behavior of the editor depends on which Tool is currently active, and in which state it is (for example, when the mouse button is down, mouse movements will be interpreted differently).
In GEF, Tools do not usually implement the editing behavior themselves. Instead, they only interpret the events and create Request objects that describe the intended user action (e.g. select, move, resize an element). These Request objects are then used to obtain Command objects (containing the code that acts on the model), show feedback (e.g. during a drag operation), or perform some other operations. This is where EditPolicies come into play. Instead of implementing the same behavior again and again for different graphical elements, GEF provides a mechanism that allows certain behavior to be attached to elements (i.e. to EditParts). All this should have been explained in great detail, with some nice diagrams making it easier to follow the complex control flow.
There are many more things that need to be explained. However, Tools are the starting point where learning to implement the editing behavior should begin, IMHO. Once you understand Tools and Requests, GEF becomes much easier to use. Discovering this (when learning GEF the hard way) was my "Eureka!" moment after which everything suddenly seemed easy. This "Eureka!" knowledge is what I would have expected from a book about GEF.
Hope this helps,
Look for similar items by category
- Books > Computers & Technology > Computer Science > Human-Computer Interaction
- Books > Computers & Technology > Programming > Java
- Books > Computers & Technology > Programming > Languages & Tools
- Books > Computers & Technology > Programming > Software Design, Testing & Engineering > Software Development
- Books > Textbooks > Computer Science & Information Systems > Programming Languages