A Formal Foundation Supporting MDD
-
Upload
kirk-walsh -
Category
Documents
-
view
30 -
download
2
description
Transcript of A Formal Foundation Supporting MDD
![Page 1: A Formal Foundation Supporting MDD](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/1.jpg)
A Formal Foundation Supporting MDD
--- ZOOM Approach
Hongming Liu
Lizhang Qin
11/08/2003
![Page 2: A Formal Foundation Supporting MDD](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/2.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/3.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/4.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/5.jpg)
Characteristics of MDD
we argue that an MDD infrastructure requires models to be
– precise– analyzable– transformable– executable
![Page 6: A Formal Foundation Supporting MDD](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/6.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/8.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/9.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/10.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/11.jpg)
ZOOM as a Meta-Modeling Language
Part of MOF Model Structure from OMG MOF Specification
![Page 12: A Formal Foundation Supporting MDD](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/12.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/13.jpg)
ZOOM Models
ZOOM Models
Structural Model UI ModelBehavioral Model
Event Model
![Page 14: A Formal Foundation Supporting MDD](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/14.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/15.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/16.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/17.jpg)
Tools Support For Automation
Basic Language Support Tools Model Validation Tools Model Verification Tools Transformation Tools
![Page 18: A Formal Foundation Supporting MDD](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/18.jpg)
Basic Language Support Tools
Lexer Parser Type Checker UML Mapping Tools Model Editing Tools
![Page 19: A Formal Foundation Supporting MDD](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/19.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/20.jpg)
Model Verification Tools
Automated Theorem Prover Static Analyzer Unit Test Generator
![Page 21: A Formal Foundation Supporting MDD](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/21.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/22.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062309/56813537550346895d9c9bcd/html5/thumbnails/23.jpg)
THANK YOU
Questions and Comments?