Introduction to OpenArchitectureWare...1. Create/edit grammar 2. Generate artefacts 3. Set...

Post on 05-Apr-2020

3 views 0 download

Transcript of Introduction to OpenArchitectureWare...1. Create/edit grammar 2. Generate artefacts 3. Set...

Introduction to

OpenArchitectureWare

ICT 1

Dr. Neil Loughran

Neil.Loughran@sintef.no

20th April 2009

Objective

� To give some insights into an alternative model transformation approach i.e. OpenArchitectureWare

� Not intended to make you an expert#� I do not cover all aspects involved

� UML models only briefly covered

� Nothing here relating to GMF

ICT 2

� Nothing here relating to GMF

� Benefit for student projects involving textual DSL creation using Eclipse plug-ins!

Introduction

� OpenArchitectureWare (oAW)

� A suite of modelling tools

� Uses EMF at the core

� Allows integration of other EMF based tools

� GMF

� EMF

ICT 3

� EMF

� Kermeta

� MOFScript

� Pure::Variants

� Etc.

� Also integration of general purpose languages such as Java.

Primary Elements

XText(T2M) Xtend(M2M) Xpand(M2T)

ICT 4

Xweave(AO-M2M)Check

(constraints)

Workflow

(sequencing)

Xtext

� Domain specific languages� Language which model a particular application domain (e.g. SQL, spreadsheet

formula, Graphviz, etc.)

� Raise the abstraction level from GPL (e.g. Java) to DSL

� Think in terms of Smart Home abstractions (e.g. sensors, power management, lighting, heating, etc.)

� DSLs can be textual or graphical.

� Complex to develop and time consuming

� Text to model

ICT 5

� Text to model� Generates a meta-model for your domain

� Also creates a parser and common defaults for errors and so forth

� Xtext provides the means to develop an editor using a BNF-like syntax� Targets Eclipse

� Can be also be independent of Eclipse

Xtext Grammar

ICT 6

Xtext Editor using the Grammar

ICT 7

Xtend

� Model transformation language

� OCL like expression language used throughout oAW

� Can be used in constraint checks, model transformations and generators

� Add “methods” to meta types (Java calls are possible if necessary)

ICT 8

� Add “methods” to meta types (Java calls are possible if necessary)

� Tool support (syntax highlighting, code completion, debugger)

Complex Xtend

ICT 9

Simple Xtend

ICT 10

Xpand

ICT 11

Check

context Type ERROR "Duplicate type detected: " + this.name :

� An OCL like constraint language

� Provides dynamic constraint support in IDE

� Allows both errors and warning to be specified

ICT 12

context Type ERROR "Duplicate type detected: " + this.name :

allElements().typeSelect(Type).select(e|e.name == this.name).size ==1;

context Type WARNING “Features should be larger than one character”:

name.size>1;

Workflow

� Defines the order of operations

� Invoke components

� Invoke transformations

� Invoke other workflows

� Example

ICT 13

� Example

Contrast with other technologies

OAW Language Related Approaches

Xtext Textual Concrete Syntax (TCS)

Xtend Atlas Transformation Language (ATL)

Kermeta

ICT 14

Kermeta

Xpand MOFScript, Model2Text, JET, VTL, Frames,

Check OCL

Advanced Features

� Multiple model files

� UML2 Adapter

� Recipes

� Aspect-Oriented transformation

� Grammar reuse?

ICT 15

� Grammar reuse?

Example:Language for Workflow Modelling

Orchestration part

Services and timing part

ICT 16

General Procedure for Development of

Textual DSL using oAW

1. Create/edit

grammar

2. Generate

artefacts

3. Set properties

to false on first

generation

Close configuration

instance

ICT 17

4. Create

configuration

instance

5. Test correctness

Of grammar in

editor

6. Alter Check files

and create templates

7. Add images and labels

(requires restart of instance)

Using oAW with UML models

� So far only covered development of textual languages

� oAW also has support for UML2 models

� All oAW languages (i.e. Xtend, Xpand et al) able to access

UML models

ICT 18

Using oAW with UML2 Models

� First you need to install the UML2 feature from eclipse.org:

http://download.eclipse.org/tools/uml2/updates/site-interim.xml

� The oAW uml2adapter is available from the oAW update site:

http://www.openarchitectureware.org/updatesite/milestone/site.xml

� Configure workflow (example fragment)

ICT 19

� Hint: General practice is to use an existing UML2 project in oAW and adapt to suit your needs!! (check oAW site for these projects!)

Open Points

� Why use a textual modelling language?

� Expressivity

� Speed?

� Quicker to develop meta-models using text! (e.g Text2UML)

� Conciseness

� Why use a graphical modelling language?

ICT 20

� Why use a graphical modelling language?

� Provide overview

� Hide complexity

� Cases for hybrid?

� Use textual for some parts of the language, graphical for other?

� Example for SOA

� express locations of services using text

� express order using UML activity diagrams

Summary

� oAW is a modelling tool suite for T2M, M2M, M2T

� Provides a workflow and constraints language

� Generates the Java for an Eclipse plug in

� Can be utilised with UML2 models

� Integrates with general purpose languages i.e. Java

ICT 21

� Integrates with general purpose languages i.e. Java

Useful Sites for oAW

� Contact me for workflow language example and this PPT.Neil.Loughran@sintef.no

� Download sites

� Update site

http://www.openarchitectureware.org/updatesite/milestone/site.xml

� Complete distribution

ICT 22

http://oaw.itemis.com/openarchitectureware/language=en/2837/downloads

� oAW Documentationhttp://www.openarchitectureware.org/pub/documentation/4.3.1/html/contents/

� Video Tutorialshttp://www.openarchitectureware.org/staticpages/index.php/oaw_screencasts

� Forumhttp://www.openarchitectureware.org/forum/?menu=Forum

Questions?

ICT 23

Questions?