INTRODUCTION TO EMF. Creating Model using EMF. Our Domain model used to showcase this use case is as shown below in fig.1

Similar documents
Kermeta tutorial. How to create an EMF meta model? François Tanguy, Didier Vojtisek, Zoé Drey, Marie Gouyette. Abstract

Modif Documentation. Refactoring User Guide

Eclipse Modeling Framework (EMF) Paweł Żalejko

How to generate new EMF model refactorings using Java code

EMF course - PACT. Etienne Borde

Comparing graphical DSL editors

Kermeta tutorial. How to create a metamodel. François Tanguy, Didier Vojtisek. Abstract

What is Wazaabi 2.0? Declarative UI framework. based on. live EMF model(s)

CISC836: Models in Software Development: Methods, Techniques and Tools

DiaGen DiaMeta Tutorial Version

ATESST2 D4.2.1 Grant Agreement

GMF 2.0 Europa Simultaneous Release

(Meta)Models between MetaEdit+

Tiger EMF Model Transformation Framework (EMT)

Model handling with EMF

Planned Review Date: June 10, 2009 Communication Channel: eclipse.tools.emf Dave Steinberg and Ed Merks

GMF Tutorial Part 3 - Eclipsepedia

How to apply EMF model refactorings

Introduction to EGF. Benoît Langlois / Thales Global Services.

A Comparison of Ecore and GOPPRR through an Information System Meta Modeling Approach

Start Up Benoît Langlois / Thales Global Services Eclipse (EMFT) EGF 2011 by Thales; made available under the EPL v1.

CIM University: Track 3 Tools Session CIM User s Group June 13, 2017

EMC Documentum Composer

S D K Q U I C K S T A R T

EAXML Demonstration Platform on Artop/Sphinx.

EGF Tutorial. Benoît Langlois Thales/EPM. EGF Tutorial by Thales; made available under the EPL v1.0

Dominique Blouin Etienne Borde

EMF Ganymede Simultaneous Release

EMC Documentum Composer

AbstractCommand, AbstractEnumerator, AbstractOverrideableCommand, AddCommand, AbstractTreeIterator, Adapter, EAnnotation.

EMC Documentum Composer

USER GUIDE. MADCAP FLARE 2018 r2. Eclipse Help

EMF Europa Simultaneous Release

Teiid Designer User Guide 7.7.0

MAENAD Modeling Workbench

MAEANAD Modeling Workbench

Model Driven Development with EMF and EclipseLink (experiences in MDD and generating user interfaces)

1. Getting Started Xpand / Xtend / Check Reference

SCA Tools: new & noteworthy

EMF Code Generation with Fujaba

Cupid Documentation. Release 0.2 (ESMF v7) Rocky Dunlap

Composer Deployment Guide. Installation

Getting Started with Eclipse/Java

EMF Model Refactoring based on Graph Transformation Concepts

AADL Graphical Editor Design

project in an industrial context

Setting Up the Development Environment

Modellierung operationaler Aspekte von Systemarchitekturen. Master Thesis presentation. October 2005 March Mirko Bleyh - Medieninformatik

IBM Mobile Portal Accelerator Enablement

AN ERD TOOL. Abstract. Ron McFadyen Applied Computer Science University of Winnipeg Winnipeg, Manitoba, Canada R3B 2E9

FeatureIDE in a Nutshell

Git version control with Eclipse (EGit) Tutorial

Teiid Designer User Guide 7.8.0

Deliverable D5.1.1 MAENAD Modeling Workbench

The Eclipse Modeling Framework and MDA Status and Opportunities

Getting Started with Papyrus for RealTime v0.9

Eclipse Automotive Working Group

GMF Tooling 3.0 Vision, Architecture, Roadmap

BPS BIRT General Designer Usability Improvements Specification

Transformational Abstraction for Java (TAJ)

Eclipse Environment Setup

EMFT 1.0 Release Review (OCL, Query, Transaction, and Validation)

Model-Independent Differences

JBoss SOAP Web Services User Guide. Version: M5

InterPSS OpenCIM User s Guide Software Release 1.2.1

Model-Driven Engineering (MDE) Lecture 1: Metamodels and Xtext Regina Hebig, Thorsten Berger

Orccad, a Model Driven Architecture and Environment for Real-Time Control. Soraya Arias Florine Boudin Roger Pissard-Gibollet Daniel Simon

Technical Solutions for the Transformation-Driven Graphical Tool Building Platform METAclipse

SMUIML Editor. Graphical Tool for Modeling Multimodal Interaction. Master Thesis. Saïd Mechkour

Eclipse as a Web 2.0 Application Position Paper

A Formal Approach to Modeling and Model Transformations in Software Engineering

Dominique Blouin Etienne Borde

SpagoBI Meta. Angelo Bernabei 2014/10/28 10:29

Purpose. Why use Java? Installing the Software. Java

EATOP: An EAST-ADL Tool Platform for Eclipse

ADF Code Corner How-to bind custom declarative components to ADF. Abstract: twitter.com/adfcodecorner

The Error Handler Project. Clyde Carryl. Android Components [Summer 2012] Florida Atlantic University

epnk: A generic PNML tool Users and Developers Guide

EMF GENERATION PORTFOLIO

TOP Server Client Connectivity Guide for National Instruments' LabVIEW

Smooks Developer Tools Reference Guide. Version: GA

Eclipse-based Embedded Engineering Environments Inspired by AUTOSAR

Teiid Designer User Guide 7.5.0

AutoVue Integration SDK & Sample Integration for Filesys DMS

Using Eclipse in MIS Research

LAB 1: FAMILIARITY WITH NETBEANS IDE ENVIRONMENT

Assignment 1. Application Development

KerMeta Transformation Rules

Practical Model-Driven Development with the IBM Software Development Platform

jbpm Tools Reference Guide

ECLIPSE MODELING PROJECT

Transactions in Task Models

JBoss WS User Guide. Version: CR1

1. Instructions for Accessing the FamilyTreeApp Code

Manual Eclipse CDT Mac OS Snow Leopard

Using Command Modeler

Installation and Upgrade Guide Zend Studio 7.0

Prototype User Guide Public Release Version 1

The Eclipse Rich Client Platform

Using IBM Rational Business Developer wizards to create a Web application

Transcription:

INTRODUCTION TO EMF Creating Model using EMF This is the basic method of creating the Model instance using EMF (Eclipse Modelling Framework). In this tutorial we are going to explain the following, 1. Creation of Ecore Model, Generation of GenModel from Ecore 2. Running the Model Instance by generating the code from GenModel. The EMF project 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 commandbased editing of the model, and a basic editor. Our Domain model used to showcase this use case is as shown below in fig.1 Fig 1: Model used in this Tutorial

CREATION OF ECORE MODEL, GENERATION OF GENMODEL FROM ECORE: 1. Create a new Empty EMF Project by File->New-> Project -> Empty EMF Project (Under Eclipse Modelling Framework). Then click Next button, on the next page give the project name as com.ancit.addressbook.model and click Finish button. 2. Now right click model folder under the created project in package explorer and select New-> Other -> Ecore Model (under Eclipse Modelling Framework). Click Next, give file name as AddressBook.ecore and click Finish Button. An Ecore model is created under model folder of our project. 3. Now open the AddressBook.ecore it will display a tree as given below Double click the leaf node of the tree to open the properties view. Enter the name value as AddressBookModel, Ns Prefix value as AddressBook and NS URI value as http://www.ancit.org/addressbook. 4. Right Click the AddressBookModel node and select New Child -> Class. In the properties view give the class name as AddressBook.

Similarly create two other classes namely Group and Contact. Now your AddressBook.ecore should look something like the above image. 5. Now right click the contact node and select new child- > EAttribute. On the properties view give the name value as ContactName and select the EType as EString [java.lang.string]. On selecting this EType value the EAttribute Type value also gets updated with the same value. Similarity create another EAttribute named Location. Now your AddressBook.ecore should look something like this. 6. Now right click Group node and select New Child -> EReference. On the properties view enter the name value as Contact, choose the Etype value as Contact and Containment value as true.

Now set the Lower Bound value to 0 and Upper Bound value to -1. The value -1 indicates * in this case. Similarly create an EReference for AddressBook node named Group. Additionally create EAttribute for both AddressBook and Group node named Name. Now your AddressBook.ecore should look something like the above image. 7. Let us now create EMF Generator Model for our Ecore. To do this right click the AddressBook.ecore select New->other -> EMF Generator Model (under Eclipse Modelling Framework). Click next and give the File name value as AddressBook.genmodel then click next and select Ecore Model now click next and browse for the AddressBook.ecore then click load button. With successful loading click next -> select our AddressBookModel and click finish button. An EMF genmodel gets created under model folder of our project. You can see the classes and its attributes same as in the AddressBook.ecore. The AddressBook.genmodel should look something like this 8. Now let us generate the code using the AddressBook.genmodel. To generate the source code, right click the root node of AddressBook.genmodel and select Generate All. This will generate model, edit, editor and test code in the workspace.

RUNNING THE APPLICATION: 1. Right Click the com.ancit.addressbook.model.editor project and select Run as -> Eclipse Application. The new instance of Eclipse Application appears. There create a new project (under General category), give its name as Address Book Project and click Finish. The project gets created in the Package Explorer. 2. Now right click the created project and select New -> Other. Under the Example EMF Model Creation Wizards category select AddressBookModel Model and click next. Here give the file name as MyAddressBook.addressbookmodel and click next. Now choose the model object as Address Book and click Finish button. A model instance editor gets opened with the root model object as the one as chosen in the wizard. You can set its name in properties view. To open the properties view double click the root model object. Let us give the name as 2014 in properties view. It gets updated in the model instance editor. You output should look something like this. 3. Similarly you can create Group and Contact model element by right clicking the root model object. At last you should get something like this.

REFERENCES: http://www.eclipse.org/modeling/emf/ http://eclipsesource.com/blogs/tutorials/emf-tutorial/ ABOUT ANCIT: ANCIT Consulting is an Eclipse Consulting Firm located in the "Silicon Valley of Outsourcing", Bangalore. Offers professional Eclipse Support and Training for various Eclipse based Frameworks including RCP, EMF, GEF, GMF. Contact us on annamalai@ancitconsulting.com to learn more about our services.