Organization of DSLE part. Overview of DSLE. Model driven software engineering. Engineering. Tooling. Topics:



Similar documents
Introduction à EMF Eclipse Modeling Framework

MDE Basics with a DSL Focus

Textual Modeling Languages

Eindhoven University of Technology

Model-Driven Development - From Frontend to Code

Design of Visual Repository, Constraint and Process Modeling Tool based on Eclipse Plug-ins

Co-Creation of Models and Metamodels for Enterprise. Architecture Projects.

VICCI. The Eclipse Modeling Framework (EMF) A Practical Introduction and Technology Overview. Dipl.-Inf. Christoph Seidl

A Common Metamodel for Code Generation

Development of Tool Extensions with MOFLON

Implementing reusable software components for SNOMED CT diagram and expression concept representations

Towards a Common Metamodel for the Development of Web Applications

Overview. Stakes. Context. Model-Based Development of Safety-Critical Systems

Bridging the Generic Modeling Environment (GME) and the Eclipse Modeling Framework (EMF)

Model Driven Interoperability through Semantic Annotations using SoaML and ODM

Java (12 Weeks) Introduction to Java Programming Language

Challenges in bootstrapping a model-driven way of software development

Designing a Semantic Repository

SEARCH The National Consortium for Justice Information and Statistics. Model-driven Development of NIEM Information Exchange Package Documentation

Questions? Assignment. Techniques for Gathering Requirements. Gathering and Analysing Requirements

Comparison of Model-Driven Architecture and Software Factories in the Context of Model-Driven Development

DSL Design. Model Transformations. Model Transformations. Language g Implementation Strategies

What is a metamodel: the OMG s metamodeling infrastructure

A Tool Suite for the Generation and Validation of Configurations for Software Availability

Requirements Exchange: From Specification Documents to Models

Tool Support for Model Checking of Web application designs *

Mapping between Levels in the Metamodel Architecture

Common Warehouse Metamodel (CWM): Extending UML for Data Warehousing and Business Intelligence

Roles in Software Development using Domain Specific Modelling Languages

Metamodels and Modeling Multiple Kinds of Information Systems

Integration of Microsoft Visio and Eclipse Modeling Framework Using M3-Level-Based Bridges

How To Transform Business Rules Into Optimized Processes

Author: Daniël van t Oever

A Model-Driven Approach for the Development of an IDE for Spacecraft On-Board Software

Today. Generic Language g Technology (2IS15)

Generating Aspect Code from UML Models

The ADOxx Metamodelling Platform Workshop "Methods as Plug-Ins for Meta-Modelling" in conjunction with "Modellierung 2010", Klagenfurt

Recent Advances in Eclipse QVTO!

Dr. Jana Koehler IBM Zurich Research Laboratory

Modeling Turnpike: a Model-Driven Framework for Domain-Specific Software Development *

Integration of Application Business Logic and Business Rules with DSL and AOP

Enterprise Application Development Using UML, Java Technology and XML

Automatic generation of fully-executable code from the Domain tier of UML diagrams

Towards Flexible Business Process Modeling and Implementation: Combining Domain Specific Modeling Languages and Pattern-based Transformations

Konzept und Implementierung einer Sprache zur. Model-to-Model Transformation

Course 4 27 October Adrian Iftene adiftene@info.uaic.ro

All you need are models Anneke Kleppe, Klasse Objecten

Java Generation from UML Models specified with Alf Annotations

Structure of Presentation. The Role of Programming in Informatics Curricula. Concepts of Informatics 2. Concepts of Informatics 1

Data Modeling Basics

COCOVILA Compiler-Compiler for Visual Languages

Introduction to programming

Object oriented design process

JastEMF: Reference Attribute Grammars for EMF-based DSLs

Open Source egovernment Reference Architecture Osera.modeldriven.org. Copyright 2006 Data Access Technologies, Inc. Slide 1

A SYSTEMATIC APPROACH FOR COMPONENT-BASED SOFTWARE DEVELOPMENT

OpenEmbeDD basic demo

Programmers rejoice: QML makes business people understand. Qt Developer Days 2014 Hinrich Specht 2. September 2014 Folie 1

Analysis of the Specifics for a Business Rules Engine Based Projects

Model-Driven Development: A Metamodeling Foundation

Automatic Generation of Consistency-Preserving Edit Operations for MDE Tools

Integration of Application Business Logic and Business Rules with DSL and AOP

Automatic Test Data Generation for TTCN-3 using CTE

Jairson Vitorino. PhD Thesis, CIn-UFPE February Supervisor: Prof. Jacques Robin. Ontologies Reasoning Components Agents Simulations

Generating Enterprise Applications from Models

A Service-Oriented approach dedicated to Internet based Business Process Networks: Building a MDA based collaborative platform with opensource

A SoC design flow based on UML 2.0 and SystemC

A model driven approach for bridging ILOG Rule Language and RIF

AMFIBIA: A Meta-Model for the Integration of Business Process Modelling Aspects

Core Components Data Type Catalogue Version October 2011

Modernizing Simulation Input Generation and Post-Simulation Data Visualization with Eclipse ICE

Model-Driven Health Tools (MDHT) CDA Tools Overview.

Concepts for the model-driven generation of graphical editors in Eclipse by using the Graphiti framework

A Pattern-based Approach to Business Process Modeling and Implementation in Web Services

Megamodels as models of the linguistic architecture of software products and software technologies

Static Analyzers. Context. Learning Objectives

Towards collaboration between sighted and visually impaired developers in the context of Model-Driven Engineering

U III 5. networks & operating system o Several competing DOC standards OMG s CORBA, OpenDoc & Microsoft s ActiveX / DCOM. Object request broker (ORB)

Principles of integrated software development environments. Learning Objectives. Context: Software Process (e.g. USDP or RUP)

Tool chain (BRIDE) delivered as BRICS software distribution

Language-Driven, Technology-Enhanced Instructional Systems Design

Model-Driven Architecture: Vision, Standards And Emerging Technologies

Creating visualizations through ontology mapping

Implementation and Integration of a Domain Specific Language with oaw and Xtext

2 nd UML 2 Semantics Symposium: Formal Semantics for UML

Common Warehouse Metamodel (CWM): Extending UML for Data Warehousing and Business Intelligence

A Web Specific Language for Content Management Systems

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Round-Trip Software Engineering Using UML: From Architecture to Design and Back

From Object Oriented Conceptual Modeling to Automated Programming in Java

Definition and Generation of Data Exchange Formats in AUTOSAR

Databases in Organizations

Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages

mdwfs Model-driven Schema Translation for Integrating Heterogeneous Geospatial Data

AN ONTOLOGICAL APPROACH TO WEB APPLICATION DESIGN USING W2000 METHODOLOGY

Meta Model Based Integration of Role-Based and Discretionary Access Control Using Path Expressions

Business Process Measures

ITU-T Z.100. Specification and description language (SDL)

University of Twente. A simulation of the Java Virtual Machine using graph grammars

Transcription:

Organization of DSLE part Domain Specific Language Engineering Tooling Eclipse plus EMF Xtext, Xtend, Xpand, QVTo and ATL Prof.dr. Mark van den Brand GLT 2010/11 Topics: Meta-modeling Model transformations Domain specific language design and engineering Textual / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 1 Overview of DSLE g in general DSL Design Model transformations Code generation Models are used everywhere / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 2 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 3

Models are abstractions of real life objects Models increase the level of abstraction used for both hardware and software design often manually translated into design documents and code no guarantee for consistency between model, design and resulting code / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 4 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 5 Whole range of modeling languages g are developed over the years: data oriented, e.g., E/R models, class diagrams behaviour oriented, e.g., use cases, state t machines, sequence diagrams, activity diagrams architecture oriented, e.g., package diagrams, component diagrams Standardization initiative of OMG: Unified Modeling Language UML is unified: Class diagrams Object diagrams Use cases State machine diagrams Sequence diagrams Activity diagrams Component diagrams etc. UML is too universal / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 6 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 7

Criticism on UML: It contains many diagrams and constructs that are redundant or infrequently used. Problems in learning and adopting. Linguistic incoherence. Capabilities of UML and implementation language Dysfunctional interchange format. UML is too universal : a general purpose modeling language Domain specific extension via: Profile diagram operates at tthe meta model llevel lto show stereotypes as classes with the <<stereotype>> stereotype, and profiles as packages with the <<profile>> stereotype Meta modeling / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 8 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 9 Meta-Object Facility (MOF) is a four-layered architecture: M3 Meta-Meta-Model Layer defines structure of the meta-metadata it provides a meta-meta model at the top layer M2 Meta-Model M Layer defines the structure of the metadata the M3-model is used to build meta models the most prominent example is the UML meta model, the model that describes the UML itself M1 Model Layer describes the data in the information layer the M2-models describe elements of the M1-layer For example, models written in UML M0 Model Layer describes objects or data in the information layer / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 10 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 11

Meta-Object Facility (MOF) is the OMG standard no implementation EMF is the Eclipse implementation of MOF EMF Model Definition What is an EMF model? Specification of an application s data Object attributes Relationships (associations) between objects Operations available on each object Simple constraints (e.g., multiplicity) on objects and relationships Essentially the Class Diagram subset of UML / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 12 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 13 What does EMF provide Meta-model A general model of models from which any model can be defined Models classes, attributes, relationships, data types, etc. Referred to as Ecore Ecore is just another EMF model EMF is used to implement EMF! Tooling support within the Eclipse framework Runtime environment Reflective and dynamic model invocation XML/XMI default model serialization EMF is middle ground in the modeling vs. programming world Focus is on class diagram subset of UML modeling (object model) Transforms models into efficient, correct, and easily customizable Java code Provides the infrastructure to use models effectively in your code Very low cost of entry Full scale graphical modeling tool not required EMF is free Small subset of UML / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 14 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 15

EMF Components EMF Core Ecore meta model Model change notification Persistence and serialization Reflection API Runtime support for generated models Change model and recorder Validation framework EMF Edit Helps integrate models with a rich user interface Used to build editors and viewers for your model Includes default reflective model editor EMF Codegen Code generator for core and edit based components Model importers from Rose, XML, or Java interfaces Simplified Ecore meta-modelmodel EClass models classes themselves identified by name number of attributes number of reference EAttribute models attributes identified by name has a type EDataType represents simple types / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 16 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 17 Simplified Ecore meta-model model EReference models associations between classes identified by name has a type which must be an EClass containment attribute indicating whether the EReference is used as whole- part relationship Classes, abstract classes and interfaces Attributes and Operations / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 18 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 19

Creation of abstract class Associations in the meta-model: One way association Bidirectional association / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 20 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 21 Associations in the meta-model: Containment association EMF is suited for modeling domain specific languages Inherit association / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 22 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 23

What is a Domain Specific Language g (DSL)? A DSL is a formal, procesable language targeting at a specific aspect of a system Its semantics, flexibility and notation is designed in order to support working with that aspect as good as possible How do we design a Domain Specific Language? g Establish needed language concepts domain specific abstract t corresponding semantics Graphical vs textual tua representation ese Develop tooling / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 24 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 25 Example of a Domain Specific Language g Specifying and Implementing the Controllers of Conveyor Belts We defined a domain specific language g (DSL) for modeling communicating systems Stepwise refinement to adapt the characteristics of the communication channels to the Lego Mindstorms platform State machine based combination of: graphical models and textual models conditional message exchange plus activities plus activities No data yet No timing yet / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 26

Requirements for a DSL: Unambiguous syntax Unambiguous semantics Unambiguous transformability Strongly-typed and deterministic IO Encapsulation at Expressiveness Readability Overview of workshop g in general DSL Design Model transformations Code generation Definition of a (programming) g) language g involves: abstract syntax, so-called signature concrete syntax: textual syntax graphical syntax semantics: static semantics dynamic semantics / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 30 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 31

Meta-Meta-Model Grammar world world The 4-layer architecture M3 Meta-Meta-Model (E)BNF/SDF grammar Layer defines structure of the meta-metadata (E)BNF in (E)BNF M2 Java Meta-Model grammar Layer defines the structure of Java the metadata in (E)BNF M1 Java Model program Layer describes the manipulation data in the information (algorithm) layer of objects in the object M0 layer Information Layer M0 data Object we wish layer to describe Objects we wish to manipulate Abstract syntax: defines basic structure of the language (skeleton) is starting point for defining: concrete syntax static semantics dynamic semantics / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 32 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 33 Abstract syntax is a collection of constructors/- functions No information about keywords, priorities, iti associativities, etc. Abstract syntax definition of Booleans: true () -> BoolCon false () -> BoolCon con (BoolCon) -> Bool and (Bool, Bool) -> Bool or (Bool, Bool) -> Bool not (Bool) -> Bool constructor nonterminal Definition of a (programming) language involves: lexical syntax, so-called tokens: identifiers, numbers, strings, if, then, class (keywords) context-free syntax, so-called production rules: Statement ::= if Expression then Statements else Statements fi static semantics: identification and scope resolution type checking dynamic semantics: operational semantics interpretation compilation / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 34 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 35

There is no standardized way of defining abstract syntax SSL (specification formalism of the Synthesizer Generator) Signature-like (Meta-modeling) SSL (grammar specification formalism of the Synthesizer Generator) describes it as follows: A collection of rules that define phyla and operators A phylum is a nonempty set of terms A term is the application of a k-ary operator to k terms of the appropriate phylum A k-ary operator is a constructor function mapping k terms to a term A phylum can be considered a nonterminal phyl 0 : op(phyl 1 phyl 2 phyl k ) / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 36 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 37 SSL notation of the definition of the abstract syntax of Booleans: boolcon : True() False() bool : Con(boolcon) And(bool bool) Or(bool bool) Signature describes it as follows: A collection of functions that define sorts and operators A sort represents a nonempty set of terms A term is the application of a k-ary operator to k terms of the appropriate sort A k-ary operator is a constructor function mapping k terms to aterm A sort can be considered a nonterminal op(sort( 1, sort 2,, sort k ) sort 0 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 38 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 39

Signature notation of the definition of the abstract syntax of Booleans: true () -> BoolCon false () -> BoolCon con (BoolCon) -> Bool and (Bool, Bool) -> Bool or (Bool, Bool) -> Bool not (Bool) -> Bool Meta-modeling is the analysis, construction and development of the frames, rules, constraints, models and theories applicable and useful for modeling a predefined class of problems. Relation between meta-models and grammars? Is every meta-model a context-free grammar? Is every context-free grammar a meta-model? / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 40 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 41 Models and meta-models: Warmer et.al.: A model is a description of (part of) a system written in a welldefined language A meta-model is a model that defines the language for expressing a model A meta-model is the collection of concepts (things, terms, etc.) within a certain domain and an attempt at describing the world around us for a particular purpose. Meta-models are also referred to as a precise definition of the constructs and rules needed for creating semantic models. The meta-model of a language, also known as abstract syntax, is a description of all the concepts that can be used in that language. Syntax Grammar Program Meta-model MDE Model Schema DBMS Schema XML Document Data / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 42 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 43

First alternative meta-model for Booleans: Every operator (not, or, and) is modeled as a separate class Constructors (true, false) are modeled as enumeration Second alternative at e meta-model for Booleans: Binary operator is modeled as a separate class Unary operator is modeled as a separate class Operators are modeled as enumerations Constructors (true, false) are modeled as enumeration First alternative for Boolean meta-model Signature: true () -> BoolCon false () -> BoolCon BoolCon -> Bool AndBool -> Bool OrBool -> Bool NotBool -> Bool and (Bool, Bool) -> AndBool or (Bool (Bool, Bool) -> OrBool not (Bool) -> NotBool / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 44 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 45 First alternative for Boolean meta-model First alternative for Boolean meta-model / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 46 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 47

Second alternative for Boolean meta-model Signature: true () -> BoolCon false () -> BoolCon BoolCon -> Bool BinaryBool -> Bool UnaryBool -> Bool bin (BinaryOp, Bool, Bool) -> BinaryBool una (UnaryOp, Bool, Bool) -> UnaryBool not () -> UnaryOp and () -> BinaryOp or () -> BinaryOp Second alternative for Boolean meta-model / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 48 / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 49 Second alternative for Boolean meta-model / Faculteit Wiskunde en Informatica 9-11-2010 PAGE 50