Difference between revisions of "EMF"
From Suhrid.net Wiki
Jump to navigationJump to search (→Intro) |
|||
Line 35: | Line 35: | ||
* Notification observers/listeners in EMF are called adapters, because they're used to extend the behaviour of the object they are attached to. | * Notification observers/listeners in EMF are called adapters, because they're used to extend the behaviour of the object they are attached to. | ||
* The ability to persist and reference other persisted objects, is one of the most important benefits of EMF modeling. | * The ability to persist and reference other persisted objects, is one of the most important benefits of EMF modeling. | ||
+ | |||
+ | = EMF.Edit = | ||
+ | |||
+ | * EMF.Edit is used to build functional viewers and editors for the model. | ||
+ | * Functionality such as display, edit, copy-paste, drag-n-drop, unlimited undo and redo. | ||
+ | |||
+ | == Eclipse UI Framework == | ||
+ | |||
+ | * JFace is a Eclipse UI toolkit with classes for handling many common UI programming tasks. JFace is window-system-independent in both its API and implementation, and is designed to work with SWT without hiding it. JFace is essentially a set of API's built on top of SWT. (SWT provides native look and feel widgets as compared to Swing) | ||
+ | * |
Revision as of 08:49, 21 June 2012
Contents
Intro
- Eclipe Modeling Framework (EMF) is a modeling framework and code generation facility for building tools and other applications based on a structured data model.
- From a model specification described in XMI, EMF provides tools and runtime support to produce a set of Java classes for the model, along with a set of adapter classes that enable viewing and command-based editing of the model, and a basic editor.
- The most important benefit of EMF, as with modeling in general is the boost in productivity that results from automatic code generation. [pp 23. 2.4 Generating Code Eclipse EMF.]
- A domain model represents that data we want to work with. The data should be modeled irrespective of the application logic.
- Eclipse EMF is used to model these domain models.EMF makes a distinction between Meta models and actual model. The meta model describes the structure of the model and the model with data is an instance of this meta model.
- In the UML world, this is equivalent to a class diagram which describes the meta-model and an object digram describes the actual model.
- In fact, EMF is only concerned with one aspect of UML - Class Modeling.
- EMF provides a pluggable framework to store the model definition, the default method is to use XMI.
- The Meta model can be specified in different ways - XMI, Java annotations, UML/XML schema, textual syntax called EMFatic, Graphical editors within EMF.
EMF Metamodels
- Two metamodels: Ecore and Genmodel.
ECore
- The Ecore metamodel contains the information about the defined classes.
- The Ecore model allows the definition of the following elements:
- EClass
- EAttribute
- EReference: One end of an association between two classes.
- EDataType: Type of an attribute.
- Ecore model editor shows the model itself as the root, followed by the packages, then classes and then attributes.
- UML2 modeling is an EMF-based implementation of the UML 2.x metamodel for the Eclipse platform.
GenModel
- The Genmodel contains additional information for generating code, e.g. the path and file information. The genmodel contains also the control parameter how the coding should be generated.
- Where to place generated code, what prefix to use for generated factory and package class names - the kind of information that is not stored in the Ecore model, but is user settable. The EMF code generator uses a generator model to store this information. Like Ecore, the generator model is itself an EMF model.
- The genmodel provides all the data required for code generation by wrapping the Ecore model.
Runtime Framework
- Every generated EMF class is a notifier, it can send notification whenever an attribute or reference is changed. This allows EMF objects to be observed.
- Notification observers/listeners in EMF are called adapters, because they're used to extend the behaviour of the object they are attached to.
- The ability to persist and reference other persisted objects, is one of the most important benefits of EMF modeling.
EMF.Edit
- EMF.Edit is used to build functional viewers and editors for the model.
- Functionality such as display, edit, copy-paste, drag-n-drop, unlimited undo and redo.
Eclipse UI Framework
- JFace is a Eclipse UI toolkit with classes for handling many common UI programming tasks. JFace is window-system-independent in both its API and implementation, and is designed to work with SWT without hiding it. JFace is essentially a set of API's built on top of SWT. (SWT provides native look and feel widgets as compared to Swing)