Model-based development Meta-modelling creating new languages - - PowerPoint PPT Presentation

model based development
SMART_READER_LITE
LIVE PREVIEW

Model-based development Meta-modelling creating new languages - - PowerPoint PPT Presentation

TDT4250 - Model-driven Development of Information Systems, Autumn 2009 Model-based development Meta-modelling creating new languages Domain-specific languages some languages are domain-specific Model-based


slide-1
SLIDE 1

Meta.ppt 1

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Model-based development

  • Meta-modelling
  • creating new languages
  • Domain-specific languages
  • some languages are domain-specific
  • Model-based techniques
  • general techniques
slide-2
SLIDE 2

3

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

What reasons are there for creating specialized modeling languages? (structure the discussion according to the language quality categories)

Goals of modelling Language extension

Modeling domain

Social actor interpretation Technical actor interpretation Social actor explicit knowledge Model externalization

Comprehensibility appropriateness Organizational appropriateness Participant appropriateness Domain appropriateness Tool appropriateness Modeller appropriateness

slide-3
SLIDE 3

4

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Central concepts

Meta-levels: according to the classification

abstraction-mechanisms

Meta-levels used in modeling

Instance: John Krogstie as lecturer in TDT4250 in 2007 Model (type): Lecturer in course Meta-model: Entity class, relationship class Meta-meta-model: Node, edge

Language-model vs. meta-model

Semantic description vs. basis for model-repository Conceptual vs. logical vs. physical language-model

slide-4
SLIDE 4

5

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Conceptual language model of main parts of EEML: Goal modelling and process modelling

slide-5
SLIDE 5

6

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Example of Logical language model (of DIAMODL)

slide-6
SLIDE 6

7

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Languages for language and meta-modeling

Typically based on a structural perspective

ER or similar UML (class diagrams) GOPRR (Graph Object Property Role Relationship) (Used in

Metaedit)

Rule languages to represent additional constraints Limited use of behavioral models for languages

with an operational semantics (state transition diagrams/sequence diagrams)

slide-7
SLIDE 7

Meta.ppt 8

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Domain-specific modeling using MetaEdit

Based on a presentation by Steven Kelly MetaCase Consulting

slide-8
SLIDE 8

9

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Contents

Introduction What is domain-specific modeling (DSM)? Benefits of DSM DSM case studies How to implement domain-specific methods Demonstration of examples Summary

slide-9
SLIDE 9

10

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

What is domain-specific modeling

Captures domain knowledge (as opposed to code)

Uses domain abstractions Applies domain concepts and rules as modeling constructs

Allows developers to design products with domain

terms

Apply familiar terminology Solve the right problems Solve problems only once

slide-10
SLIDE 10

11

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Main potential benefits of DSM

Fundamental productivity improvements (3-10 times)

Shorter intervals Lower costs Fewer people needed

Faster change responsiveness

Manage changes in domain instead of code

Leverage expertise inside the team

Put your expert’s knowledge in a tool

“Hide” domain complexity

DSM includes domain rules

http://www.dsmforum.org

slide-11
SLIDE 11

12

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

DSM Case Study: Nokia

DSM and related code generators for

mobile phone*

Order of magnitude productivity gains (10x)

"A module that was expected to take 2 weeks... took 1 day

from the start of the design to the finished product"

Focus on designs rather than code

Domain-oriented method allows developers to concentrate

  • n the required functionality

Training time was reduced significantly

“Earlier it took 6 months for a new worker to become

  • productive. Now it takes 2 weeks”

* MetaCase, Nokia case study, 1999

slide-12
SLIDE 12

13

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

DSM Case Study: Lucent

5ESS Phone Switch* Several DSMs One DSM (called RAD): specifying configuration

control units and relationships between them

Translation to state machines Translation to C

Reported productivity improvements of about 3-10

times

From several cases From several DSMs

* D. Weiss et al, Software Product-Line Engineering, Addison-Wesley

slide-13
SLIDE 13

14

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

DSM Case Study: USAF

Development of message translation and

validation system*

Declarative domain-specific language + code generators and customization of

components

Compared DSM against component-based

development:

DSM is 3 times faster than code components DSM leads to fewer errors: about 50% less DSM gives “superior flexibility in handling a greater range of

specifications” than components

* Kieburtz et al., A Software Engineering Experiment in Software Component Generation, ICSE

slide-14
SLIDE 14

15

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Domain Idea Finished Product

Components Domain Model Generate calls to components Easy!

Expert (few) Normal (many)

Done a few times before!

  • Code

generation Domain metamodel Component library

How to implement DSM

slide-15
SLIDE 15

16

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

How to implement DSM

Investment:

Define metamodel for the

domain

About 1-2 man-weeks Build tool support 1 man-day for building a

modeling tool (!) Payback:

Apply in software

production Design DSM Use DSM DSM and tools Applications Feedback

slide-16
SLIDE 16

17

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Concepts Symbols Generators Rules 1 2 3 4

Steps for implementing DSM

slide-17
SLIDE 17

18

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

  • 1. Design domain concepts

Map modeling concepts accurately to domain concepts Concentrate on semantics! Add extensions for software production later Keep in mind the end-user (user-friendliness of the DSM)

slide-18
SLIDE 18

19

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Metamodelling concepts of GOPRR

Concepts

Graph Object Property Role Relationship

Rules, e.g.

Max 1 Min 1 Unique, etc

Links between models Reuse rules

slide-19
SLIDE 19

20

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Metametamodel

Object Role Relationship

Metamodel

Button Alarm

Model

Wake InstanceOf

System in operation

Down button pressed InstanceOf Down InstanceOf Sets InstanceOf

GOPRR Domain language Concepts Rules Symbols Reports Product specifications

Property Graph

Model architecture (By ISO & OMG)

slide-20
SLIDE 20

21

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

  • 2. Define domain rules

Define semantics and rules as they exist in the

domain

slide-21
SLIDE 21

22

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

  • 3. Draw symbols (notation)

Define symbols illustrating as well as possible the

corresponding domain concepts’ natural ”visualization”

e.g end-users’ notation, customers’ notation

Notations of diagrams, matrixes, tables, forms,

text etc.

slide-22
SLIDE 22

23

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

  • 4. Implement generators

The cost of developing the code generation is

defrayed over a few users

Write report definitions

based on domain concepts

Component use Code generation Review etc.

slide-23
SLIDE 23

24

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Apply in software production

Develop applications (domain instances) using the

DSM infrastructure

Prototype your design, refine and iterate

slide-24
SLIDE 24

25

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Example: from coding to modeling

slide-25
SLIDE 25

26

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Defining metamodel

slide-26
SLIDE 26

28

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Summary

Domain-specific modeling can

radically improves productivity in certain domains (5-10x)

DSM leverages expert developers’

abilities to empower other developers in a team

MetaCASE tools provide a cost-

effective way to create DSM infrastructure

Building DSM is great fun for

experts (but is also challenging) 10x

slide-27
SLIDE 27

29

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Other approaches/environments applying meta- modelling on this level

Microsoft Visual Studio

http://msdn.microsoft.com/vstudio/DSLTools/

Eclipse http://www.eclipse.org/gmf & xtext Different UML tools (often limited to UML profiles)

slide-28
SLIDE 28

30

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Effective Transformations

slide-29
SLIDE 29

31

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

What About MDA?

A way to build applications in UML using

A platform-independent UML model (PIM) Many platform-specific UML models (PSM)

Its primary goal is platform independence

Real needs are interoperability and productivity

What doesn’t MDA address?

How to make models precise enough to compile What to model for given type of system How to integrate models with requirements, architecture,

frameworks, patterns, code...

How to fit models into the development process How to use models across the life cycle

slide-30
SLIDE 30

32

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Domain Specific Languages

Used to automate rote and menial tasks

Success in broad horizontal domains: SQL,

Windows Form Designer

Designed to support the concepts defined

by an underlying framework

Increase agility by visualizing concepts,

generating code and other artifacts, enabling rapid iteration

Building them must be fast, cheap and easy

slide-31
SLIDE 31

33

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

Not What UML Does Well

Addresses only a few domains well

Testing, Database, User Process, Services

Hard to implement consistently in tools

Large, complex, inconsistent, disorganized

Weak extension mechanisms

Stereotypes and tags have no behavior

Inconsistent one-size-fits-all semantics

Defined by prose not by translation or execution

Defines model structure inside the model

Makes models hard to map to storage systems

slide-32
SLIDE 32

35

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

DSL with Eclipse

EMF provides platform for DSL

Ecore – (meta)model for design and runtime EMF.Edit & Editor – edit support and tree-based editor EMF.Codegen – generic code generation mechanism

GMF – graphical editor runtime and generator

builds on Ecore model of language concepts domain-specific languages for (among others)

graphical syntax, i.e. structure of diagram symbols mapping between conceptual language and graphical syntax

generates a complete graphical editor

palette and pop-up tools for editing saves concepts and diagram elements in separate files

slide-33
SLIDE 33

36

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

DSL with Eclipse

Xtext – text editor runtime and generator

domain-specific language for

textual language grammer implicitly defines Ecore language model

generates a complete textual editor

syntax coloring and highlighting completion navigation and find references folding, outline and quick outline syntax checking / error markers

slide-34
SLIDE 34

37

TDT4250 - Model-driven Development of Information Systems, Autumn 2009

Q

DSL with Eclipse

Model transformations

model to model (M2M) using ATL (QVT) model to text (M2T) using JET or Xpand