The role of OCL in the Model Driven Architecture Jos Warmer Klasse Objecten

Slides:



Advertisements
Similar presentations
Copyright © 2006 Data Access Technologies, Inc. Open Source eGovernment Reference Architecture Approach to Semantic Interoperability Cory Casanave, President.
Advertisements

Software Engineering Model Driven Architecture
1Model Driven Architecture – 3. März 2008 – Siegfried Nolte 1.UML – What is it and what is it good for ? 2.MDA – What is it and what is it good for ? 3.MDA.
1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 11 Brief introduction to the UML Specification (Based on UML Superstructure.
OCL2 April A presentation of OCL 2 Object Constraint Language Christian Hein, Fraunhofer FOKUS April 2006.
Object Constraint Language Design by Contract and Queries Dan Massey Y&L Consulting.
Page 1 Automatic Evaluation of Modelling Rules and Design Guidelines, July 2006 Automatic Evaluation of Modelling Rules and Design Guidelines Tibor Farkas,
Which role might model-based engineering play in software certification? Selo Sulistyo.
Feb 2003 R McFadyen1 Contracts (Ch 13) Used to help understand requirements more completely based on assertions; assertions are applicable to any.
1 Model-driven development of SOA with Web services – using QVT technology Master thesis by Berge Stillingen Department of Informatics, University of Oslo.
Formal Techniques in Software Engineering Universiteit AntwerpenIntroduction 1.1 Formal Techniques in Software Engineering 3de BAC Informatica Chapter.
OMG‘s MDA: An Overview copyright © 2001, MATHEMA AG OMG‘s MDA: An Overview OMG‘s MDA: An Overview Markus Völter
MDA > Model Driven Architecture > Orçun Dayıbaş > December, 2006 > METU, Ankara.
MDA and QVT in Together Architect 2006  Pavel Kobiakov, Borland Software Corporation  06 December 2005.
Specifying Agent Interaction Protocols with AUML and OCL COSC 6341 Project Presentation Alexei Lapouchnian November 29, 2000.
7 July 2003 MDA presentation Dennis Wagelaar 1 Model-Driven Architecture The current state of affairs.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
Model Driven Architecture (MDA) Partha Kuchana. Agenda What is MDA Modeling Approaches MDA in a NutShell MDA Models SDLC MDA Models (an Example) MDA -
Whole Platform Tesi di Dottorato di: RICCARDO SOLMI Università degli Studi di Bologna Facoltà di scienze matematiche, fisiche e naturali Corso di Dottorato.
OMG Meeting, Helsinki Model Driven Architecture An Alternative Implementation Approach Werner Froidevaux
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
HL7 UK 2003 (c) Abies Ltd Modelling Clinical Information Using UML Tim Benson Abies Ltd
Software Engineering Model Driven Architecture Software Engineering 2012 Department of Computer Science Ben-Gurion university Based on the book: MDA Explained:
Faculty of Informatics and Information Technologies Slovak University of Technology Peter Kajsa and Ľubomír Majtás Design.
MDA and QVT  Tom Gullion, Director of Product Management, Together Products.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 9, Object Design: Specifying Interfaces.
MDE Model Driven Engineering Xavier Blanc Université Pierre et Marie Curie
3 April SOA: Services Oriented Architecture MDA: Model Driven Architecture.
Model transformation with a dedicated imperative language IRISA Rennes (France) - Triskell team Jean-Marc Jézéquel Didier Vojtisek Jean-Philippe Thibault.
Introduction to MDA (Model Driven Architecture) CYT.
2nd TTCN-3 User Conference, June The TTCN-3 Metamodel – A Basis for Tool Integration Ina Schieferdecker TU Berlin/Fraunhofer Fokus Hajo Eichler,
ISO/IEC CD and WD : Core Model and Model Mapping ISO/IEC JTC1/SC32/WG September 2005, Toronto SC32/WG2 Japan (Kanrikogaku Ltd) Masaharu.
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
Model Driven Development An introduction. Overview Using Models Using Models in Software Feasibility of MDA MDA Technologies The Unified Modeling Language.
XASTRO-2 Overview Presentation CCSDS SAWG Athens Meeting 12 th April 2005.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 9, Object Design: Specifying Interfaces.
UML-1 3. Capturing Requirements and Use Case Model.
1 OCL The Role of OCL in UML. 2 רשימת הנושאים  מבוא  מרכיבי השפה  דוגמאות  מקורות.
UML-1 8. Capturing Requirements and Use Case Model.
XASTRO Metamodel. CCSDS SAWG2 Presentation Outline XASTRO-1 Metamodel XASTRO-2 Metamodel Alignment with Model Driven Architecture.
IM NTU Software Development Methods, Fall2006 Software Development Methods, Fall 2006 OCL 2006/12/ Object Constraint Language (OCL) Yih-Kuen Tsay.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
CIM LAB MEETING Presentation on UML Rakesh Mopidevi Kwangyeol Ryu.
Modeling the ODP Computational Viewpoint with UML 2.0: The Templeman Library Example José Raúl Romero, Antonio Vallecillo Universidad de Málaga, Spain.
MDA & RM-ODP. Why? Warehouses, factories, and supply chains are examples of distributed systems that can be thought of in terms of objects They are all.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Formal Methods in Software Engineering1 Today’s Agenda  Quiz 1 Return  Project Discussion  Quick Review  Finish Introduction to OCL.
Software Engineering Modern Approaches Eric Braude and Michael Bernstein 1.
XASTRO-2 Presentation CCSDS SAWG th November 2004.
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.
UML Course Instructor: Rizwana Noor. Overview  Modeling  What is UML?  Why UML?  UML Diagrams  Use Case  Components  Relationships  Notations.
CEN th Lecture Advance Software Engineering (CEN-5011) Instructor: Masoud Sadjadi Object Design: Specifying.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
A Flexible MDATool Set Anneke Kleppe Klasse Objecten.
Model Driven Performance Analysis University College London James Skene –
Model Driven Architecture MDA SE-548 Lale Doğan
Page 1 Hitachi Ltd. – FhI FOKUS TTCN-3 User Conference, June 2005 MDA based approach for generation of TTCN-3 test specifications Hideto Ogawa, Hitachi.
Used to help understand requirements more completely
The Object Constraint Language
The Object Oriented Approach to Design
Modelling Clinical Information Using UML
Evaluating Compuware OptimalJ as an MDA tool
A (Very) Short Introduction to Model-Driven Development (MDD)
OMG - Model Driven Architectures
Constructing MDA-based Application Using Rational XDE for .NET
The Object Constraint Language
Model Driven Software Development
Object Constraint Language (OCL)
Software Architecture & Design
Presentation transcript:

The role of OCL in the Model Driven Architecture Jos Warmer Klasse Objecten

Klasse Objecten Part 1 The role of modeling in software development.

Klasse Objecten Modeling Maturity Levels MML 0: No specification MML 1: Textual Specification MML 2: Text with Models MML 3: Models with Text MML 4: Precise Models MML 5: Models only

Klasse Objecten MML 0: No Specification Specification of software is kept in the heads of the developers.  My software …

Klasse Objecten MML 1: Textual Specification of software is written down in one or more natural language documents.

Klasse Objecten MML 2: Text with Diagrams Specification of software in one or more natural language documents… … plus several high-level diagrams to explain the overall architecture. +

Klasse Objecten MML 3: Models with Text Specification of software is written down in one or more models. Additional natural language text is used to explain the background and motivation of the models. +

Klasse Objecten MML 4: Precise Models Specification of software is written down in one or more models. –Natural language text is used to explain the background and motivation of the models. The models are precise enough to have a direct link with the actual code. This is what the OMG calls MDA or Model Driven architecture.

Klasse Objecten MML 5: Models Only The models are precise and detailed enough to allow complete code-generation. The code is invisible (as assembler is today). Modeling language  High level programming language. This is future technology (  ).

Klasse Objecten UML in the MMLs MML 0: No use of UML MML 1: No use of UML MML 2: Moderate use of UML MML 3: Extensive use of UML MML 4: Extensive use of UML with OCL MML 5: ???

Klasse Objecten MDA and MML OMG’s Model Driven Architecture is designed for MML level 4 –Ultimate goal is level 5 UML and OCL play an important role

Klasse Objecten MDA Overview Automatic transformation from platform independent model (PIM) to platform specific models (PSM). –PIM usually written in UML. –PSM can be diverse: Java, J2EE, SQL, C++,.NET, COBOL, C#, CORBA, XML, etc. etc. –Bridges between PSMs generated as well.

Klasse Objecten MDA Example  SQL - EJB  EJB - JSP  Platform Independent Model PSM JSPPSM SQLPSM EJB

Klasse Objecten Experience in moving to MDA Companies moving from MML 3 to MML 4 (MDA) realize the need for OCL and are using it. Tools vendors developing tools for MDA realize the same and add support for OCL (e.g. ArcStyler, OptimalJ).

Klasse Objecten Part 2: OCL

Klasse Objecten Object Constraint Language OCL is about objects OCL is a language OCL is not just about constraints OCL is the UML expression / query language

Klasse Objecten History of OCL Syntropy influenced by Z Language for Business Modeling IBM/ObjecTime OMG submission Part of UML standard Extended and formally defined for UML 2.0

Klasse Objecten OCL Characteristics Ease-of-use –Readable and writeable by wide audience Pure expression language –Side-effect free Specification language –Declarative and platform independent Precision –Unambiguous, formal (?)

Klasse Objecten Example Model Bottle capacity : Integer contents : Integer weight : Integer diameter : Integer neckDiameter : Integer totalWeight() : Integer Cap innerDiameter : Integer weight : Integer 0..1 cap 0..* bottles Crate capacity : Integer maxWeight : Integer maxDiameter : Integer totalWeight() : Integer addBottle(b : Bottle) 0..1 bottle 0..1 Pallet capacity : Integer maxWeight : Integer totalWeight() : Integer addCrate(c : Crate) 0..1 crates 0..* pallet crate 0..* / caps

Klasse Objecten Invariants on Classes context Crate -- the number of bottles may not exceed its capacity inv: bottles->size() <= capacity -- each bottle must fit in the crate inv: bottles->forAll(diameter < maxDiameter) -- the total weight must be less than the maximum inv: totalWeight() <= maxWeight

Klasse Objecten Invariants on Classes context Crate -- each bottle must fit in the crate inv: bottles->forAll(diameter < maxDiameter) FORALL b : Bottle FROM bottles ISTRUE b.diameter < maxDiameter

Klasse Objecten State invariants context Bottle state Closed inv: contents = capacity open closed Bottle capacity : Integer contents : Integer weight : Integer diameter : Integer neckDiameter : Integer totalWeight() : Integer

Klasse Objecten Design by Contract Pre- and post-conditions Takes “Design by Contract” principle into “Analysis by Contract”

Klasse Objecten Preconditions on Operations context Crate::addBottle( b : Bottle ) -- there must be room in the crate pre: bottles->size() < capacity -- the maximum weight for the crate may not be exceeded pre: totalWeight() + b.totalWeight() <= maxWeight -- the bottle is not in the crate pre: not bottles->includes( b ) -- ‘b’ is added to the collection of bottles post: bottles =

Klasse Objecten Use Case Pre/Postcondtions A use-case can be viewed as a “system function”. Use case assumptions and results can be specified in OCL.

Klasse Objecten Components Specified by an (or more) interface(s) –Operations with pre- and postconditions –Invariants on the objects described by the interface Show business rules for the component OCL 2.0 Message clause –Specify user visible side-effects

Klasse Objecten Business Rules There may be at most as many caps with winner markers on a pallet as there are crates on the pallet: context Pallet inv: caps->select(winnerMark = true)->size() size() SIZEOF SELECT c : Cap FROM self.caps WHERE c.winnerMark = true <= SIZEOF self.crates

Klasse Objecten Initial values and derivations -- The caps in a pallet are derived: context Pallet::cap derive: crates.bottles.cap->asSet() context Bottle::contents init: 0

Klasse Objecten Operation body The body of a query operation can be specified in OCL context Bottle::totalWeight() : Integer body: weight + cap.weight context Crate::totalWeight() : Integer body: weight + bottles.totalWeight()->sum()

Klasse Objecten Guards open closed close [ contents=capacity ] Bottle capacity : Integer contents : Integer weight : Integer diameter : Integer neckDiameter : Integer totalWeight() : Integer

Klasse Objecten Expressions in a UML model The target object in an interaction can be specified. Object flows in activity diagrams Parameters to messages and signals … etc. …

Klasse Objecten Queries OCL is a Query Language –Expressive power >= SQL David Akehurst, Canterbury University Boldsoft –Uses OCL exclusively as a query language to specify the user interface Queries can be defined on the model level

Klasse Objecten Part 3: The MDA Framework

Klasse Objecten MDA MDA is defined around: –Models –Model Transformations Important model types: –PIM : Platform Independent Model –PSM : Platform Specific Model

Klasse Objecten Basic MDA Framework Source Model Target Model Transformation Tool CodePIMPSM Transformation Tool Transformation Tool

Klasse Objecten MDA Framework Source Model Target Model Transformation tool Transformation definition Transformation Tool

Klasse Objecten MDA To enable this we need –Modeling languages –Transformation definitions

Klasse Objecten MDA Framework Source Model Target Model Transformation tool Language Is written in Is used by Language Is written in Transformation definition

Klasse Objecten Defining Languages model Is written in metamodel Is defined by Language Is written in meta language

Klasse Objecten MDA Framework Source Model Target Model Transformation tool Transformation definition Language Is written in Is used by Is written in Meta language Is written in Is written in

Klasse Objecten Defining Transformations A transformation definition maps –Element(s) from the source language to –Element(s) from the target language based on the respective language definitions

Klasse Objecten Source Model Target Model Transformation tool Transformation definition Language Is written in Is used by Is written in Meta language Is written in Is written in Transformation definition language Is written in

Klasse Objecten Complete MDA Framework Languages are defined by models –These are metamodels, e.g. UML These models are written in a metamodeling language: –MOF is the OMGs metamodeling language Transformation Definition Language –MOF RfP for Query/Views/Transformations

Klasse Objecten Part 3: OCL in MDA

Klasse Objecten OCL in MDA OCL is essential for MDA in three ways –More precise models –Definition of Modeling Languages –Transformation definitions

Klasse Objecten Defining Languages UML metamodel Context Class inv: attributes->isUnique(name) Class name : Integer Attribute name : String 0..* owner 1 attributes

Klasse Objecten UML Metamodel Rules [2] An AssociationClass cannot be defined between itself and something else. self.allConnections->forAll(ar | ar.participant <> self) [1] An Interface can only contain Operations. self.allFeatures->forAll(f | f.oclIsKindOf(Operation) or f.oclIsKindOf(Reception))

Klasse Objecten UML Profile Rules Rules for e.g. Java profile: context Class inv: generalizations->size() <= 1 Other profiles: –EDOC, CORBA, C++, EAI, UML-EJB, SPE, etc. etc.

Klasse Objecten Transformation Definition Company name : Integer employees : Set(Person) Person name : String Company name : Integer Person name : String 0..* employees transforms to

Klasse Objecten Transformation Definitions Transformation ManyAssociationToAttribute (UML, UML) { source ae : UML::AssociationEnd ; target att : UML::Attribute; source condition ae.multiplicity = MultiplicityKind::many; target condition att.visibility = VisibilityKind::public and att.type.isTypeOf(Set); mapping ae.name att.name; ae.type att.type.elementType; }

Klasse Objecten References MDA Explained, Practice and Promise of the Model Driven Architecture –ISBN unknown, to appear Spring 2003, Kleppe, Warmer & Bast The Object Constraint Language, Precise Modeling with UML –ISBN , 1999, Warmer & Kleppe The Object Constraint Language, Getting Your Models Ready for MDA –ISBN , to appear May 2003, Warmer & Kleppe OCL 2.0 Submission –

Klasse Objecten Questions

Klasse Objecten Part 4: Current Status

Klasse Objecten OCL 2.0 Submission Authoring Team Jos Warmer, Anneke KleppeKlasse Objecten Anders Ivner, Jonas HögströmBoldsoft Martin Gogolla, Mark RichtersUniversity of Bremen Heinrich Hussmann, Steffen Zschaler Technical university of Dresden Tony ClarkKings College, London Simon JohnstonRational

Klasse Objecten OCL 2.0 Submission Submitters and supporters Klasse ObjectenIBM BoldsoftTelelogic University of BremenProject Technology, Inc. Technical university of DresdenAdaptive Ltd. Kings College, LondonCompuware Rational Software CorporationUniversity of York IONAUniversity of Kent Kabira Technologies, Inc.

Klasse Objecten OCL 2.0 Submission Highlights Full UML query language Complete OCL metamodel  full integration with UML metamodel Concrete syntax strictly separated from abstract syntax  allows alternative syntaxes, including visual ones Semantics defined mathematically and in UML

Klasse Objecten UML 2.0 Structure Infrastructure (ad/ ) –Simple and extensible UML core Superstructure (ad/ ) –Higher level UML structures OCL (ad/ ) –General purpose UML expression language Diagram interchange (ad/ ) –Exchange visual UML models between tools