Mint is a proposed open source component in the Eclipse Modeling Framework Technology (EMFT) project whose goal is to improve out-of-the-box user experience when developing EMF-based solutions. For the most part, this is accomplished by extending Java Development Tools (JDT) with EMF-specific enhancements.
This proposal is in the Project Proposal Phase (as defined in the Eclipse Development Process document) and is written to declare its intent and scope. This proposal is written to solicit additional participation and input from the Eclipse community. You are invited to comment on and/or join the component. Please send all feedback to the eclipse.technology.emft newsgroup (please prefix the subject with [mint]).
The EMF SDK comes with basic structured editors that allow for development of Ecore models and subsequent generation of related Java code. Furthermore, EMF supports creating Ecore models from Javadoc-annotated source code. However, there are opportunities for tighter integration with existing development tools, particularly JDT, given EMF's meta-data-driven nature. While providing a full-scale model-driven application development environment is not part of the EMF's charter (rather, it is left up to extenders and add-on providers), we believe that several relatively small enhancements would go a long way toward improving out-of-the-box experience when developing EMF-based applications.
The functionality initially contributed:
- Java model decoration
- Structured viewer filters for generated Java code
- Java search integration
- GenModel-to-Java navigation actions
- Java Editor enhancements
Additional functionality considered:
- Logical structure providers for debugging
- Java refactoring integration
- Java 5 Annotations and annotation processors
Note that the scope can be further augmented as warranted by community interest.
The initial contribution provides usability enhancements in the following areas:
- Structured viewers displaying Java elements, such as Java Editor's Content Outline or the Package Explorer, can be configured to highlight generated Java members (such as types, methods, and member variables). Additionally, generated members that were explicitly customized can also be highlighted.
- Viewer filters are provided to selectively hide generated, customized, or non-generated members can be applied to structured viewers displaying Java elements (such as those mentioned above).
- Searching for Java element references (currently packages and types) reports GenModel elements from which the elements were generated. For instance, searching for references to a generated factory implementation reports the GenModel package from which the factory was generated.
- Default GenModel editor provides additional context menu items that allow for navigation to corresponding generated types. For instance, right-clicking an GenClass allows one to open the generated interface, implementation class, item provider, and test case (if any).
- Java Editor allows for one-click customization of generated method. That is, right-clicking a generated method and selecting Source -> Customize EMF-Generated method creates a corresponding *Gen() method and annotates the original as @generated NOT. This is a common decoration pattern that allows for easy re-use of generated code in customized methods.
Additional enhancements considered for implementation will cover the following areas:
- Ecore-aware logical structure providers, used by the Debug framework to allow the user to view structured data in a more abstract form, will display EObject or Resource containment trees in a more succinct manner (for easy navigation). Alternatively, the data may be displayed according to the hierarchy provided by the registered item provider adapter factory.
- Java refactoring participants, which are invoked whenever a Java element is being refactored, may be able effect the corresponding refactoring on the Ecore/GenModel. This is particularly applicable to cases where the Ecore model is generated from annotated Java code.
- Ecore-specific Java 5 Annotations, designed to closely resemble the Javadoc-based annotations currently in use, will allow registered annotation processors to translate annotation changes to their corresponding Ecore/GenModels. This will automate the model-reload-generate cycle that is frequently employed when developing EMF-based applications (especially when annotated Java code is used as the model source).
Relationship with other Eclipse-based Projects
Initially, Mint builds upon the functionality provided by the EMF project itself. However, it is envisioned that Mint could benefit from contributions made by the Search component, particularly in the area of Java search integration.
Furthermore, incremental code generation based on Java 5 Annotations may be possible with an annotation processor utilizing the JET2 functionality. More investigation is required to determine if this is feasible and how it could be implemented.
On the whole, features and enhancements contributed by Mint should be applicable to other projects that base their models around Ecore, such as the Graphical Modeling Framework (GMF). Model-specific solutions can be developed when necessary (e.g., GMF-specific navigation actions for the various GMF editors).
Peter Nehrer, Ecliptical Software Inc.
- JDT Extensions for EMF from Ecliptical Software Inc.
- Ed Merks, IBM
- Lucas Bigeardel
Interested parties are welcome to add themselves to the list above as interested parties or to suggest changes to this document.
The initial set of committers is expected to grow given the component's focus on improving EMF-based development in general. Any EMF user with ideas on how to improve EMF-related tooling is encouraged to contribute.
- 2007-11: Initial release to EMF team for study and feedback
- 2007-12: First public release for community study