Introduction to OpenArchitectureWare Dr. Neil Loughran Neil.Loughran@sintef.no 20 th April 2009 ICT 1
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 Benefit for student projects involving textual DSL creation using Eclipse plug-ins! ICT 2
Introduction OpenArchitectureWare (oaw) A suite of modelling tools Uses EMF at the core Allows integration of other EMF based tools GMF EMF Kermeta MOFScript Pure::Variants Etc. Also integration of general purpose languages such as Java. ICT 3
Primary Elements XText(T2M) Xtend(M2M) Xpand(M2T) Xweave(AO-M2M) Check (constraints) Workflow (sequencing) ICT 4
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 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 ICT 5
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) Tool support (syntax highlighting, code completion, debugger) ICT 8
Complex Xtend ICT 9
Simple Xtend ICT 10
Xpand ICT 11
Check An OCL like constraint language Provides dynamic constraint support in IDE Allows both errors and warning to be specified 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; ICT 12
Workflow Defines the order of operations Invoke components Invoke transformations Invoke other workflows Example ICT 13
Contrast with other technologies OAW Language Xtext Related Approaches Textual Concrete Syntax (TCS) Xtend Xpand Check Atlas Transformation Language (ATL) Kermeta MOFScript, Model2Text, JET, VTL, Frames, OCL ICT 14
Advanced Features Multiple model files UML2 Adapter Recipes Aspect-Oriented transformation Grammar reuse? ICT 15
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 6. Alter Check files and create templates 5. Test correctness Of grammar in editor 4. Create configuration instance 7. Add images and labels (requires restart of instance) ICT 17
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) Hint: General practice is to use an existing UML2 project in oaw and adapt to suit your needs!! (check oaw site for these projects!) ICT 19
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? 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 ICT 20
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
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 http://oaw.itemis.com/openarchitectureware/language=en/2837/downloads oaw Documentation http://www.openarchitectureware.org/pub/documentation/4.3.1/html/contents/ Video Tutorials http://www.openarchitectureware.org/staticpages/index.php/oaw_screencasts Forum http://www.openarchitectureware.org/forum/?menu=forum ICT 22
Questions? ICT 23