Model Driven Engineering Graphical User Interfaces for Web
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Eclipse GMF Fábio M. Pereira Ramon Rabello
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Agenda § § GMF – What is it? EMF – Overview GEF – Overview GMF – Models 9/30/2020 GEF - Graphical Modeling Framework 2
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GMF – What is it? § It provides a generative component and runtime infrastructure for developing graphical editors based on EMF (Eclipse Modeling Framework) and GEF (Graphical Editing Framework) § It enables to produce graphical editors for Eclipse – For example, a UML modeling tool, workflow editor, etc. – Basically, a graphical editing surface for any domain model in EMF 9/30/2020 GEF - Graphical Modeling Framework 3
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GMF – What is it? 9/30/2020 GEF - Graphical Modeling Framework 4
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Scenario 9/30/2020 GEF - Graphical Modeling Framework 5
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Components 9/30/2020 GEF - Graphical Modeling Framework 6
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GMF Runtime § Its features provide a consistent look and feel with other GMF-based graphical editors § Its editors can be created manually from the ground up and/or be generated from the great tooling currently being developed as part GMF's SDK § It manages diagram persistence, allowing clients to focus on their business logic § Its extensible nature allows GMF Runtime clients to be fully open editors that in turn can be extended by third-parties 9/30/2020 GEF - Graphical Modeling Framework 7
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GMF Runtime § It is already integrated with various new EMFT components such as validation and OCL should you need such support § It defines an extensible notation meta-model to enable the isolation of notation from semantic concerns § Its features are well designed, coded, tested, and deployed § Future community enhancements to the runtime will easily be integrated with your editor 9/30/2020 GEF - Graphical Modeling Framework 8
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia EMF Overview Centro de Informática – CIn/UFPe ORCAS Group
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group EMF – Eclipse Modeling Framework § The EMF project is a modeling framework and code generation facility for building tools and other applications based on a structured data model § The key concepts underlying the framework are: meta-data, code generation, and default serialization 9/30/2020 GEF - Graphical Modeling Framework 10
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group EMF Benefits § Increase productivity § Model change notification § Persistence support including default XMI and schema-based XML serialization § A framework for model validation § A very efficient reflective API for manipulating EMF objects generically § Most important of all, EMF provides the foundation for interoperability with other EMF-based tools and applications 9/30/2020 GEF - Graphical Modeling Framework 11
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Developing an Eclipse plug-in using EMF § 1: Designing the model – The first step is to design the data model for the application - that is, the structure of the data we want to be able to view and edit, and the relationships between data items – You may find a UML tool useful, or a piece of paper § 2: Defining the model – The next step is to define the model to EMF so that code can be generated § 3: Generating the model – Now that the model has been defined, we can proceed to generate the model implementation § 4: Generating an editor § 5: Trying out the generated plug-ins 9/30/2020 GEF - Graphical Modeling Framework 12
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Defining an EMF Model § Our model definition can be provided to the EMF code generator in a number of ways: – UML: if you have a modeling tool that works with EMF, you can simply draw the class diagram (*. uml) – XMI: we could describe the model directly in an XMI document (*. ecore) – Export the XMI document from the Rational Rose modeling tool (*. mdl) – Annotate Java interfaces with model properties (*. java) – Use XML Schema to describe the form of a serialization of the model (*. xsd; *. wsdl) 9/30/2020 GEF - Graphical Modeling Framework 13
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GEF Graphical Editing Framework Overview
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GEF – Graphical Editing Framework § It allows to easily develop graphical representations for existing models – It is possible to develop feature rich graphical editors using GEF § All graphical visualization is done via the Draw 2 D framework, which is a standard 2 D drawing framework based on SWT from eclipse. org 9/30/2020 GEF - Graphical Modeling Framework 15
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GEF – Graphical Editing Framework § Its editing possibilities allow you to build graphical editors for nearly every model – With these editors, it is possible to do simple modifications to your model, like changing element properties or complex operations like changing the structure of your model in different ways at the same time – All these modifications to your model can be handled in a graphical editor using very common functions like drag and drop, copy and paste, and actions invoked from menus or toolbars 9/30/2020 GEF - Graphical Modeling Framework 16
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Models
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GMF Generated Diagram Editor 9/30/2020 GEF - Graphical Modeling Framework 18
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group GMF Generation Overview 9/30/2020 GEF - Graphical Modeling Framework 19
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Develop Graphical Definition It is used to define the figures, nodes, links, etc. that you will display on your diagram 9/30/2020 GEF - Graphical Modeling Framework 20
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Develop Tooling Definition It is used to specify the palette, creation tools, actions, etc. for your graphical elements 9/30/2020 GEF - Graphical Modeling Framework 21
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Mapping Definition 9/30/2020 GEF - Graphical Modeling Framework 22
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Develop Mapping Definition 9/30/2020 GEF - Graphical Modeling Framework 23
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Create Generator Model 9/30/2020 GEF - Graphical Modeling Framework 24
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Generate Diagram Plug-in and Run Diagram 9/30/2020 GEF - Graphical Modeling Framework 25
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Validation § Validation Rules are written in OCL § They are defined in GMF Map model – State has ‘States should have unique names’ validation rule – Rules for source and target of a Transition § ‘Stop. State cannot be a source for a transition’ for Stop. State § ‘Start. State cannot be a target for a transition’ for Transition 9/30/2020 GEF - Graphical Modeling Framework 26
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group Conclusions § Creating graphical editors for domain models is fairly straightforward § Using GMF is an iterative process § GMF code can be customized § It allows M 2 M transformations 9/30/2020 GEF - Graphical Modeling Framework 27
Model Driven Engineering Graphical User Interfaces for Web 2. 0 Sites Model. Pedia Centro de Informática – CIn/UFPe ORCAS Group References § Eclipse GMF website http: //www. eclipse. org/gmf § Eclipse Modeling Framework (EMF) website http: //www. eclipse. org/emf § Graphical Modeling Framework (GEF) website http: //ww. eclipse. org/gef § Using GMF and M 2 M for Model-Driven Development (Fesenko, T. ; Dvorak, R. ; Kolb B. ; Voelter, M. ) § Introducing the GMF Runtime. http: //www. eclipse. org/articles/Article. Introducing-GMF/article. html § From Front End To Code - MDSD in Practice. http: //www. eclipse. org/articles/Article-From. Frontend. To. Code. MDSDIn. Practice/article. html 9/30/2020 GEF - Graphical Modeling Framework 28
- Slides: 28