WP 3.3 © Copyright Xactium, TUBS & TUD 2008 - 1 - How to build a set of DSLs: from Theory to Practise Xactium, TUBS, Jendrik Johannes (TUD)

Slides:



Advertisements
Similar presentations
GenArch: Automatic Product Derivation in Multi-agent Systems Product Line Elder Cirilo.
Advertisements

Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
Component Oriented Programming 1 Chapter 2 Theory of Components.
June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Transforming models with ATL The A TLAS Transformation Language Frédéric Jouault ATLAS.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development.
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Object-Oriented Analysis and Design
The Knowledge Industry Survival Strategy (KISS) Tony Clark, Thames Valley University, London, UK Jorn Bettin, Sofismo, Switzerland.
UML – Class Diagrams.
Object-Oriented Theories for Model Driven Architecture Tony Clark, King’s College, UK. Andy Evans, University of York, UK. Robert France, Colorado University,
WebDynpro for ABAP Short introduction.
A Framework for Distributed Preservation Workflows Rainer Schmidt AIT Austrian Institute of Technology iPres 2009, Oct. 5, San.
Reuse Activities Selecting Design Patterns and Components
Generative Programming. Generic vs Generative Generic Programming focuses on representing families of domain concepts Generic Programming focuses on representing.
MDE In A Sales Management System: A Case Study © 2008 INRIA, TUD & SAP MDE In A Sales Management System: A Case Study Mathias Fritzsche, Hugo Bruneliere,
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Comparing M2T & M2M Complementary Approaches © 2008 INRIA, University of York & SINTEF Comparing M2T & M2M Complementary Approaches Hugo Bruneliere,
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Deriving AO Software Architectures using the AO-ADL Tool Suite Luis Fernández, Lidia Fuentes, Mónica Pinto, Juan A. Valenzuela Universidad de Málaga
Advanced Applications Of Model-to-Model Transformation © 2008 INRIA Advanced Applications Of Model-to-Model Transformation Hugo Bruneliere & Frédéric.
Composing Models: Principles & Techniques © Copyright TUBS & TUD Composing Models: Principles & Techniques Steven Völkel & Jendrik Johannes.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 18 Slide 1 Software Reuse.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
Ontologies Reasoning Components Agents Simulations Agent Modeling Language: Behavioral Models Rafael Oliveira Ricson Santana Vinícius Remigo Jacques Robin.
Xactium xDSLs Run Models Not Code Tony Clark
MARTE Tutorial An OMG standard: UML profile to develop Real-Time and Embedded systems Overview, NFP / VSL, GCM.
CSE301 University of Sunderland Harry R Erwin, PhD
Slide 1 Wolfram Höpken RMSIG Reference Model Special Interest Group Second RMSIG Workshop Methodology and Process Wolfram Höpken.
An Introduction to Software Architecture
©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Component-based development l Building software from reusable components l Objectives.
Introduction to MDA (Model Driven Architecture) CYT.
Assessing the Suitability of UML for Modeling Software Architectures Nenad Medvidovic Computer Science Department University of Southern California Los.
The Grid Component Model: an Overview “Proposal for a Grid Component Model” DPM02 “Basic Features of the Grid Component Model (assessed)” -- DPM04 CoreGrid.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Alignment of ATL and QVT © 2006 ATLAS Nantes Alignment of ATL and QVT Ivan Kurtev ATLAS group, INRIA & University of Nantes, France
Building Tools by Model Transformations in Eclipse Oskars Vilitis, Audris Kalnins, Edgars Celms, Elina Kalnina, Agris Sostaks, Janis Barzdins Institute.
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
UML Profiles Eclipse ECESIS Project The UML Profile technology SOFTEAM 144 Ave des Champs Elysées Paris, France
SaveUML System design. System overview Possible...
Usage of OCL April Usage of OCL for design guidelines of models Christian Hein, Fraunhofer FOKUS April 2006.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
© DATAMAT S.p.A. – Giuseppe Avellino, Stefano Beco, Barbara Cantalupo, Andrea Cavallini A Semantic Workflow Authoring Tool for Programming Grids.
Applications Of Model Weaving Techniques © 2008 INRIA & TUD Applications Of Model Weaving Techniques Hugo Bruneliere, Jendrik Johannes INRIA, TUD.
IBM Software Group ® Overview of SA and RSA Integration John Jessup June 1, 2012 Slides from Kevin Cornell December 2008 Have been reused in this presentation.
Generative Programming. Automated Assembly Lines.
Illustrations and Answers for TDT4252 exam, June
Introduction to Model-Driven Simulation © 2008 SAP, TU Dresden, XJ Technologies Introduction to Model-Driven Simulation Mathias Fritzsche 1, Jendrik.
An ATL Example © 2005 ATLAS Nantes An ATL Example The BibTeXML to DocBook Transformation ATLAS group (INRIA & LINA), University of Nantes, France.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Copyright © IBM Corp., | March | Creating Robust Scalable DSLs with UML Tutorial (172) James Bruck, Christian Damus IBM Rational Software.
© Siemens AG, CT SE 2 C O R P O R A T E T E C H N O L O G Y 1 Model-Driven Development for Pluggable Collaborations Iris Groher, Stephan Bleicher, Christa.
November 25, 2015 © IBM Corporation Unified Method Framework (UMF) RMC Reference Architecture Overview Kelli Houston
Reusable Specification of Non-functional Properties in DSLs Francisco Durán, Steffen Zschaler, and Javier Troya 28 September, 2012.
Introduction To Model-to-Model Transformation © 2008 INRIA Introduction To Model-to-Model Transformation Hugo Bruneliere & Frédéric Jouault INRIA.
Advanced Software Development Karl Lieberherr CSG 260 Fall Semester
UML Profile BY RAEF MOUSHEIMISH. Background Model is a description of system or part of a system using well- defined language. Model is a description.
EMEA Beat Schwegler Architect Microsoft EMEA HQ Ingo Rammer Principal Consultant thinktecture
An Introduction to Metamodelling Eclipse ECESIS Project An Introduction to Metamodelling Principles & Fundamentals Department of Computer Science,
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
UML (Unified Modeling Language)
Extending Model-Driven Engineering in Tango
Object-Oriented Analysis and Design
SysML v2 Formalism: Requirements & Benefits
Model-Driven Analysis Frameworks for Embedded Systems
Implementing Language Extensions with Model Transformations
Chapter 20 Object-Oriented Analysis and Design
An Introduction to Software Architecture
Semantic Markup for Semantic Web Tools:
Implementing Language Extensions with Model Transformations
Software Architecture & Design
Presentation transcript:

WP 3.3 © Copyright Xactium, TUBS & TUD How to build a set of DSLs: from Theory to Practise Xactium, TUBS, Jendrik Johannes (TUD)

WP 3.3 © Copyright Xactium, TUBS & TUD Context of this work The present courseware has been developed within the context of the MODELPLEX European IST FP6 project ( Co-funded by the European Commission, the MODELPLEX project involves 21 partners from 8 different countries. MODELPLEX aims to define and develop a coherent infrastructure specifically for the application of MDE to the development and subsequent management of complex systems within a variety of industrial domains. To achieve the goal of the large-scale adoption of MDE, MODELPLEX promotes the idea of the collaborative development of courseware dedicated to this domain. The MDE courseware provided here with the status of open- source software is produced under the EPL 1.0 licence.

WP 3.3 © Copyright Xactium, TUBS & TUD Outline Introduction to DSLs What are DSLs? (overview, with examples Why are they topical? (Discussion of drivers for DSLs) Who is using them? (Examples of use) What is the business benefit? (The value proposition to industry) Relationship within Modelplex (how they contribute to Modelplex) Existing technologies (Eclipse, MS, etc) Architecture of a DSL Core concepts (Define core concepts and terminology) Structure of DSLs (Basic building blocks: abstract syntax, etc) Measurements of quality (How to determine the quality of the DSL – may be a section in it own right)

WP 3.3 © Copyright Xactium, TUBS & TUD Outline Continued Building a DSL Domain analysis (Understanding the domain that is to be modelled) Building an abstract syntax model (Basic steps in building a metamodel) Understanding syntax (What should the interface to a DSL be?) Developing a visual editor (Steps in creating a visual editor) Other types of editors (For example textual) Semantics (Giving the DSL meaning) Modularisation for DSLs (adding modularisation support) An example (Take them through a small example using Eclipse) Building a DSL family (Examples of how to facilitate reusable DSL development)

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Modularisation Languages need modularization concepts Reduce complexity Improve reusability Challenges Modularization influences syntax and semantics Requires additional tooling support Reuseware [1][2] Does not influence design of DSL syntax or semantics DSL syntax can be extended at the end (but does not have to be) Composes modularized models to monolithic models DSL semantics do not require extension Generic tooling can be used with arbitrary DSLs [1] On Language-Independent Model Modularisation,Transactions on Aspect-Oriented Development, 2008 [2]

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Modularisation with Reuseware Reuseware approach Define a composition system with modularisation concepts (or reuse a predefined one) E.g., Modules, Packages, Aspects, etc. Optional: Extend DSL syntax with concepts for variation points Variation points allow definition of templates Define a reuse extension for your DSL Binds the composition system to your DSL E.g., what are the specifics of a module in your DSL, what identifies and aspect, etc. Reuseware can now handle modularization in your DSL

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Modularisation – Example Taipan DSL [3] (Metamodel excerpt) [3] Tutorial#Quick Start

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Modularisation – Example

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Modularisation – Example Different concerns should be separated into model fragments Port mode (configuration of ports and routes) Flotilla model (ships and their relations) Cargo model (Cargo and its properties)

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Modularisation – Example Different concerns should be separated into model fragments Port mode (configuration of ports and routes) Flotilla model (ships and their relations) Cargo model (Cargo and its properties)

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Reuseware - Overview Model Fragments (Partial) models that may contain variation points Offer a Composition Interface Composition Interface consists of Ports Ports point at elements of the model fragment that can be accessed for composition Composition Programs Define composition links between Ports Can be executed to produce a composed model where model fragments are merged at the elements pointed out by the linked Ports

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Reuseware - Overview Composition Systems Define modularisation concepts (e.g., Modules, Packages, Aspects) Define relations between modularisation concepts (e.g, an aspect relates to a core) Reuse extensions (for DSLs) Define how modularization concepts defined in a composition system are realized in a concrete DSL Define which ports are related to which model elements of a model fragment

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Reuseware - Composition Systems A composition system defines Fragment roles Role a model fragment plays in the modularisation (e.g., aspect or core) Fragment roles collaborate through associations between ports Static ports Defined for one fragment role Each fragment playing the role has to offer the port Dynamic ports Defined for one fragment role Each fragment playing the role can offer several of these ports Contribution Associations Defines that two ports are related Executing a composition link between the two ports will trigger the copying of model elements Configuration Associations Defines that two ports are related Executing a composition link between the two ports will NOT trigger the copying of model elements

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: ReuseTaipan - a Composition System compositionsystem reuseTaipan { fragment role TravelSpace { static port VehicleContainer; dynamic port Routes; dynamic port Places; } fragment role Flotilla { static port Vehicles; dynamic port RouteSlots; dynamic port PlaceSlots; } contribution Flotilla.Vehicles --> TravelSpace.VehicleContainer; configuration Flotilla.RouteSlots --> TravelSpace.Routes; configuration Flotilla.PlaceSlots --> TravelSpace.Places; fragment role ItemHolder { dynamic port ItemSpaces; } fragment role ItemContainer { dynamic port Items; } contribution ItemContainer.Items --> ItemHolder.ItemSpaces; }

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: ReuseTaipan - a Composition System compositionsystem reuseTaipan { fragment role TravelSpace { static port VehicleContainer; dynamic port Routes; dynamic port Places; } fragment role Flotilla { static port Vehicles; dynamic port RouteSlots; dynamic port PlaceSlots; } contribution Flotilla.Vehicles --> TravelSpace.VehicleContainer; configuration Flotilla.RouteSlots --> TravelSpace.Routes; configuration Flotilla.PlaceSlots --> TravelSpace.Places; fragment role ItemHolder { dynamic port ItemSpaces; } fragment role ItemContainer { dynamic port Items; } contribution ItemContainer.Items --> ItemHolder.ItemSpaces; } A TravelSpace offers a place where vehicles can be placed (VehicleContainer) and a number of Routes and Places

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: ReuseTaipan - a Composition System compositionsystem reuseTaipan { fragment role TravelSpace { static port VehicleContainer; dynamic port Routes; dynamic port Places; } fragment role Flotilla { static port Vehicles; dynamic port RouteSlots; dynamic port PlaceSlots; } contribution Flotilla.Vehicles --> TravelSpace.VehicleContainer; configuration Flotilla.RouteSlots --> TravelSpace.Routes; configuration Flotilla.PlaceSlots --> TravelSpace.Places; fragment role ItemHolder { dynamic port ItemSpaces; } fragment role ItemContainer { dynamic port Items; } contribution ItemContainer.Items --> ItemHolder.ItemSpaces; } A Flotilla offers a set of Vehicles and has a number of placeloders for routes (RouteSlots) and places (PlaceSlots)

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: ReuseTaipan - a Composition System compositionsystem reuseTaipan { fragment role TravelSpace { static port VehicleContainer; dynamic port Routes; dynamic port Places; } fragment role Flotilla { static port Vehicles; dynamic port RouteSlots; dynamic port PlaceSlots; } contribution Flotilla.Vehicles --> TravelSpace.VehicleContainer; configuration Flotilla.RouteSlots --> TravelSpace.Routes; configuration Flotilla.PlaceSlots --> TravelSpace.Places; fragment role ItemHolder { dynamic port ItemSpaces; } fragment role ItemContainer { dynamic port Items; } contribution ItemContainer.Items --> ItemHolder.ItemSpaces; } A Flotilla contributes Vehicles to a TravelSpace’s VehicleContainer; a RouteSlots can be configured with a Route; a PlaceSlots can be configured with a Place

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: ReuseTaipan - a Composition System compositionsystem reuseTaipan { fragment role TravelSpace { static port VehicleContainer; dynamic port Routes; dynamic port Places; } fragment role Flotilla { static port Vehicles; dynamic port RouteSlots; dynamic port PlaceSlots; } contribution Flotilla.Vehicles --> TravelSpace.VehicleContainer; configuration Flotilla.RouteSlots --> TravelSpace.Routes; configuration Flotilla.PlaceSlots --> TravelSpace.Places; fragment role ItemHolder { dynamic port ItemSpaces; } fragment role ItemContainer { dynamic port Items; } contribution ItemContainer.Items --> ItemHolder.ItemSpaces; } An ItemHolder offers different ItemSpaces

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: ReuseTaipan - a Composition System compositionsystem reuseTaipan { fragment role TravelSpace { static port VehicleContainer; dynamic port Routes; dynamic port Places; } fragment role Flotilla { static port Vehicles; dynamic port RouteSlots; dynamic port PlaceSlots; } contribution Flotilla.Vehicles --> TravelSpace.VehicleContainer; configuration Flotilla.RouteSlots --> TravelSpace.Routes; configuration Flotilla.PlaceSlots --> TravelSpace.Places; fragment role ItemHolder { dynamic port ItemSpaces; } fragment role ItemContainer { dynamic port Items; } contribution ItemContainer.Items --> ItemHolder.ItemSpaces; } An ItemContainer contains and offers Items

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: ReuseTaipan - a Composition System compositionsystem reuseTaipan { fragment role TravelSpace { static port VehicleContainer; dynamic port Routes; dynamic port Places; } fragment role Flotilla { static port Vehicles; dynamic port RouteSlots; dynamic port PlaceSlots; } contribution Flotilla.Vehicles --> TravelSpace.VehicleContainer; configuration Flotilla.RouteSlots --> TravelSpace.Routes; configuration Flotilla.PlaceSlots --> TravelSpace.Places; fragment role ItemHolder { dynamic port ItemSpaces; } fragment role ItemContainer { dynamic port Items; } contribution ItemContainer.Items --> ItemHolder.ItemSpaces; } Items can be individually assigned to ItemSpaces

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Extending a Metamodel for Variation Three kinds of variation points required RouteSlot PortSlot ItemSpace For each kind of variation point we... Introduce a superclass for the metaclass that defines the elements which may replace the variation point (e.g., we introduce RouteType as a superclass of Route in the case of RouteSlot) We redirect all references to the metaclass to the new superclass (e.g., all references to Route are redirected to RouteType) We introduce a new subclass for the just introduced superclass that represents the variation point. This class needs properties from which a name can be derived. (e.g., we introduce RouteSlot as a subclass of RoutType)

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Extending a Metamodel for Variation

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Extending a Metamodel for Variation (extension for PortSlot not shown; similar to RouteSlot)

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Reuseware - Reuse Extensions A Reuse Extension defines How a composition interface define by a fragment role (which is defined in a composition system) is linked to the content of a model fragment Each port links to a set of model elements treated as: Prototype: Element that can be copied with its contained elements Anchor: Element that can be referenced by other elements Hook: Variation point where Prototypes can be put Slot: Variation point where Anchors can be put

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL reuseextension reuseTaipan implements reuseTaipan epackages Rootclass TravelSpace { fragment role TravelSpace { port VehicleContainer { Aquatory.ships is hook {} Aquatory.ports is hook {} Aquatory.routes is hook {} } port Routes { Route is anchor { port expr = $self.description$ } port Places { Port is anchor { port expr = $self.location.concat('Port')$ } fragment role Flotilla { port Vehicles { Aquatory.ships is prototype {} Aquatory.ports is prototype {} Aquatory.routes is prototype {} } port RouteSlots { RouteSlot is slot { port expr = $self.name$ } port PlaceSlots { PortSlot is slot { port expr = $self.name$ }... The ReuseTaipan composition system is bound to the Taipan DSL (referred to by the URI of its metamodel)

WP 3.3 © Copyright Xactium, TUBS & TUD 2008 reuseextension reuseTaipan implements reuseTaipan epackages Rootclass TravelSpace { fragment role TravelSpace { port VehicleContainer { Aquatory.ships is hook {} Aquatory.ports is hook {} Aquatory.routes is hook {} } port Routes { Route is anchor { port expr = $self.description$ } port Places { Port is anchor { port expr = $self.location.concat('Port')$ } fragment role Flotilla { port Vehicles { Aquatory.ships is prototype {} Aquatory.ports is prototype {} Aquatory.routes is prototype {} } port RouteSlots { RouteSlot is slot { port expr = $self.name$ } port PlaceSlots { PortSlot is slot { port expr = $self.name$ } Building a DSL: Binding ReuseTaipan to Taipan DSL The references ships, ports and routes of the metaclass Aquatory all act as hooks accessible through the VehicleContainer port

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL VehicleContainer

WP 3.3 © Copyright Xactium, TUBS & TUD 2008 reuseextension reuseTaipan implements reuseTaipan epackages Rootclass TravelSpace { fragment role TravelSpace { port VehicleContainer { Aquatory.ships is hook {} Aquatory.ports is hook {} Aquatory.routes is hook {} } port Routes { Route is anchor { port expr = $self.description$ } port Places { Port is anchor { port expr = $self.location.concat('Port')$ } fragment role Flotilla { port Vehicles { Aquatory.ships is prototype {} Aquatory.ports is prototype {} Aquatory.routes is prototype {} } port RouteSlots { RouteSlot is slot { port expr = $self.name$ } port PlaceSlots { PortSlot is slot { port expr = $self.name$ } Building a DSL: Binding ReuseTaipan to Taipan DSL Each Route is an anchor accessible through individual ports; the ports are named using the description attribute of the Route metaclass (OCL Expression: self.description)

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL Northern Route Baltic Route

WP 3.3 © Copyright Xactium, TUBS & TUD 2008 reuseextension reuseTaipan implements reuseTaipan epackages Rootclass TravelSpace { fragment role TravelSpace { port VehicleContainer { Aquatory.ships is hook {} Aquatory.ports is hook {} Aquatory.routes is hook {} } port Routes { Route is anchor { port expr = $self.description$ } port Places { Port is anchor { port expr = $self.location.concat('Port')$ } fragment role Flotilla { port Vehicles { Aquatory.ships is prototype {} Aquatory.ports is prototype {} Aquatory.routes is prototype {} } port RouteSlots { RouteSlot is slot { port expr = $self.name$ } port PlaceSlots { PortSlot is slot { port expr = $self.name$ } Building a DSL: Binding ReuseTaipan to Taipan DSL Each Port is an anchor accessible through individual ports; the ports are named using the location attribute of the Port metaclass

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL StockholmPort HamburgPort RostockPort

WP 3.3 © Copyright Xactium, TUBS & TUD 2008 reuseextension reuseTaipan implements reuseTaipan epackages Rootclass TravelSpace { fragment role TravelSpace { port VehicleContainer { Aquatory.ships is hook {} Aquatory.ports is hook {} Aquatory.routes is hook {} } port Routes { Route is anchor { port expr = $self.description$ } port Places { Port is anchor { port expr = $self.location.concat('Port')$ } fragment role Flotilla { port Vehicles { Aquatory.ships is prototype {} Aquatory.ports is prototype {} Aquatory.routes is prototype {} } port RouteSlots { RouteSlot is slot { port expr = $self.name$ } port PlaceSlots { PortSlot is slot { port expr = $self.name$ } Building a DSL: Binding ReuseTaipan to Taipan DSL All elements of the references ships, ports and routes of the metaclass Aquatory act as prototypes accessible through the Vehicles port

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL Vehicles

WP 3.3 © Copyright Xactium, TUBS & TUD 2008 reuseextension reuseTaipan implements reuseTaipan epackages Rootclass TravelSpace { fragment role TravelSpace { port VehicleContainer { Aquatory.ships is hook {} Aquatory.ports is hook {} Aquatory.routes is hook {} } port Routes { Route is anchor { port expr = $self.description$ } port Places { Port is anchor { port expr = $self.location.concat('Port')$ } fragment role Flotilla { port Vehicles { Aquatory.ships is prototype {} Aquatory.ports is prototype {} Aquatory.routes is prototype {} } port RouteSlots { RouteSlot is slot { port expr = $self.name$ } port PlaceSlots { PortSlot is slot { port expr = $self.name$ } Building a DSL: Binding ReuseTaipan to Taipan DSL Each RouteSlot is a slot accessible through individual ports; the ports are named using the name attribute of the RouteSlot metaclass

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL ship2Route ship1Route

WP 3.3 © Copyright Xactium, TUBS & TUD 2008 reuseextension reuseTaipan implements reuseTaipan epackages Rootclass TravelSpace { fragment role TravelSpace { port VehicleContainer { Aquatory.ships is hook {} Aquatory.ports is hook {} Aquatory.routes is hook {} } port Routes { Route is anchor { port expr = $self.description$ } port Places { Port is anchor { port expr = $self.location.concat('Port')$ } fragment role Flotilla { port Vehicles { Aquatory.ships is prototype {} Aquatory.ports is prototype {} Aquatory.routes is prototype {} } port RouteSlots { RouteSlot is slot { port expr = $self.name$ } port PlaceSlots { PortSlot is slot { port expr = $self.name$ } Building a DSL: Binding ReuseTaipan to Taipan DSL Each PortSlot is a slot accessible through individual ports; the ports are named using the name attribute of the RouteSlot metaclass

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL ship2Port ship1Port

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL... binding ItemHolder { binding ItemSpaces { ItemSpace is hook { port expr = $self.name$ } binding ItemContainer { binding Items { Item is prototype { port expr = $self.article$ } Each ItemSpace is a hook accessible through individual ports; the ports are named using the name attribute of the ItemSpace metaclass

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL Ship2Cargo Ship1Cargo

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL... fragment role ItemHolder { port ItemSpaces { ItemSpace is hook { port expr = $self.name$ } fragment role ItemContainer { port Items { Item is prototype { port expr = $self.article$ } Each Item is a prototype accessible through individual ports; the ports are named using the article attribute of the Items metaclass

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Binding ReuseTaipan to Taipan DSL tobacco coffee guns

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Using Reuseware Tooling with a DSL Fragment Repository Light-weight repository to manage and find reusable model fragments Can instantly be used to build libraries of model fragments designed in a DSL Composition Program Editor Independent of composition systems and reuse extensions Can instantly be used to define compositions for the DSL Layout can be customized if desired

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Using Reuseware Tooling with a DSL

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Using Reuseware Tooling with a DSL The fragment repository shows model fragments, the fragment roles they can play and the details of the corresponding composition interfaces

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Using Reuseware Tooling with a DSL Fragments are added to a composition program; for each fragment one can define which fragment roles it should play in the composition program (e.g., myFlotilla is both Flottila and ItemHolder)

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Using Reuseware Tooling with a DSL Compositon links define the composition; Reuseware can execute the compositon program and produce an integrated taipan model

WP 3.3 © Copyright Xactium, TUBS & TUD Building a DSL: Using Reuseware Tooling with a DSL