a formal foundation supporting mdd

23
A Formal Foundation Supporting MDD --- ZOOM Approach Hongming Liu Lizhang Qin 11/08/2003

Upload: kirk-walsh

Post on 03-Jan-2016

25 views

Category:

Documents


2 download

DESCRIPTION

A Formal Foundation Supporting MDD. --- ZOOM Approach. Hongming Liu Lizhang Qin 11/08/2003. Agenda. Background of MDD A formal foundation for meta-modeling Formal OO Model Tools Support Comparison to other approaches. Model Driven Development(MDD). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: A Formal Foundation Supporting MDD

A Formal Foundation Supporting MDD

--- ZOOM Approach

Hongming Liu

Lizhang Qin

11/08/2003

Page 2: A Formal Foundation Supporting MDD

Agenda

Background of MDD A formal foundation for meta-modeling Formal OO Model Tools Support Comparison to other approaches

Page 3: A Formal Foundation Supporting MDD

Model Driven Development(MDD)

MDD is the notion of constructing a model that can then be transformed into a real system

MDD moves the development focus from code to model

Advantages of MDD

Page 4: A Formal Foundation Supporting MDD

Requirements of MDD

the models must capture information from three dimensions:

– The functional requirements– The architectural requirements– The target environment requirements

Page 5: A Formal Foundation Supporting MDD

Characteristics of MDD

we argue that an MDD infrastructure requires models to be

– precise– analyzable– transformable– executable

Page 6: A Formal Foundation Supporting MDD

Meta-Modeling

meta-model: a model of the modeling language

OMG’s MDA(Model Driven Architecture) framework

self-defined meta-meta-model: MOF(Meta-Object Fa

cility)

Page 7: A Formal Foundation Supporting MDD

OMG Meta-Modeling Architecture

M3: the meta-meta-model level (contains only the MOF)

M2: the meta-model level (contains any kind of meta-model, including the UML meta-model.

M1: the model level (any model with a corresponding meta-model from M2)

M0: the concrete level (any real situation represented by a given model from M1)

MetametaModelMOF/OCL

MetaModelUML, CWM

User ModelUML

User Data

Level M3

Level M2

Level M1

Level M0

Page 8: A Formal Foundation Supporting MDD

A Formal Foundation for Meta-Modeling

limitations of MOF need a meta-modeling language that provides both f

ormal syntax and semantics. an alternative approach to MOF that uses the ZOOM

as its meta-modeling language

Page 9: A Formal Foundation Supporting MDD

Z-based Object-Oriented Modeling(ZOOM)

based on the formal specification notation Z extends Z to support these object-oriented concepts. providing textual and graphical representations of mo

dels that are consistent with UML adopts a syntax that is similar to commonly used pro

gramming languages such as Java or C++.

Page 10: A Formal Foundation Supporting MDD

Core ZOOM(ZOOM-C)

Core ZOOM(ZOOM-C) is based on Z, and can be used to describe UML semantics. Similarly, UML semantics can be formally reduced to ZOOM and thus to Z. This provides a formal foundation to UML meta-modeling.

MOF OCL

ZOOM(Core)

Z

Reduce

Reduce

UML

Page 11: A Formal Foundation Supporting MDD

ZOOM as a Meta-Modeling Language

Part of MOF Model Structure from OMG MOF Specification

Page 12: A Formal Foundation Supporting MDD

ZOOM as a Meta-Modeling Language

typedef MM = ModelElement <=> ModelElement; //a relationship between ModelElementstypedef MN = ModelElement -> NameSpace;//a function map from ModelElement to NameSpaceMM Depends_On; //declare a global variable of type MMMN Contain; //declare a global variable of type MNstruct ModelElement { //struct definition Public String name, annotation; Public : noaccess String qualifiedName; Set[ModelElement] dependent, provider; NameSpace container; Invariant { //invariant definition dependent == DependsOn.image(this); provider == DependsOn.invert().image(this); container == Contain.invert(this); }} struct NameSpace extends ModelElement { Set[modelElement] containElement { containElement == contain.invert(this)}}

ZOOM Specification of core structure of MOF model

Page 13: A Formal Foundation Supporting MDD

ZOOM Models

ZOOM Models

Structural Model UI ModelBehavioral Model

Event Model

Page 14: A Formal Foundation Supporting MDD

Structural Model

Defines the functional part of the system using object-oriented concepts

Consists of a series of diagrams along with the formal specifications described by ZOOM-C

module zoom.examples.addressbook;class AddressBook { String title; List[AddressBookEntry] entries; delegates entries; // delegates the operations to entries Set[AddressBookEntry] search(SearchCriterion criterion) { requires { criterion != null; } ensures { search! = { AddressBookEntry entry in entries | entry.matchAddressBookEntry(criterion) @ entry } } }}

Page 15: A Formal Foundation Supporting MDD

Behavior Model

The central communication mechanism that links the structural models and UI models

Uses a formalized state diagram to specify the dynamic aspects of a system fsm MachineserviceStat() {

state inService { fsm MachineopStat () { state standingBy; state turningOnMotor; state accelerating; state running; state decelerating; transition standingBy to turningOnMotor : operatorStartsMachine(runSpeed) {safetyBrake.turnOff(), mainMotor.turnOn(runSpeed, out runSpeedOK)}; transition turningOnMotor to standingBy : standBy [runSpeedOK != TRUE] {mainMotor.turnOff(), safetyBrake.turnOn()}; transition turningOnMotor to accelerating : accelarate [runSpeedOK == TRUE]; } }; state inRepair; state waitingForRepair; transition inRepair to inService : returnToService(fixDate); transition waitingForRepair to inRepair : beginMaintenance(maintDate); transition inService to waitingForRepair : removeFromService(reason) {maintShop.notify(self, reason)}; }

Page 16: A Formal Foundation Supporting MDD

UI Model and Event Model

UI Model• Define a hierarchical description framework containing a set of predefined UI components• Designers can specify related visual attributes and the events that can be generated or consumed by the component

Event Model

Event

UI Event FSM Event

Standard Event

User-Defined Event

Page 17: A Formal Foundation Supporting MDD

Tools Support For Automation

Basic Language Support Tools Model Validation Tools Model Verification Tools Transformation Tools

Page 18: A Formal Foundation Supporting MDD

Basic Language Support Tools

Lexer Parser Type Checker UML Mapping Tools Model Editing Tools

Page 19: A Formal Foundation Supporting MDD

Model Validation Tools

Interpreter– ZOOM-E

A subset of ZOOM Provides imperative features similar to those in Java. Not used frequently in ZOOM model.

– Be used to exhibit the behavior of implementation specified by ZOOM-E

Animator– Provides a way for designers to verify their formal model. – “virtually” executes models without an implementation– Introduces a default model implementation that is consistent with

the formal specification using ZOOM-E– Calls interpreter to execute the implementation.

Page 20: A Formal Foundation Supporting MDD

Model Verification Tools

Automated Theorem Prover Static Analyzer Unit Test Generator

Page 21: A Formal Foundation Supporting MDD

Transformation Tools

Code Generator– Generates the implementation conforming the

formal models, for example, a method body based on the formal pre- and post-conditions

– Select different target runtime environments– Adjust XFR(Non-functional Reuqirement)

parameters, for example, security/performance.

Page 22: A Formal Foundation Supporting MDD

Comparison

ZOOM provides a high level of abstraction ZOOM separates views from models ZOOM provides a set of automated tools to

support the design and development process

Page 23: A Formal Foundation Supporting MDD

THANK YOU

Questions and Comments?