OCL 2.5 Plans Edward Willink OCL MODELS 2014

Slides:



Advertisements
Similar presentations
Object Oriented Programming
Advertisements

Optional Static Typing Guido van Rossum (with Paul Prescod, Greg Stein, and the types-SIG)
Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
The role of OCL in the Model Driven Architecture Jos Warmer Klasse Objecten
Modular and Verified Automatic Program Repair Francesco Logozzo, Thomas Ball RiSE - Microsoft Research Redmond.
Programming Languages and Paradigms
OCL2 April A presentation of OCL 2 Object Constraint Language Christian Hein, Fraunhofer FOKUS April 2006.
Chapter 7: User-Defined Functions II
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
II. Middleware for Distributed Systems
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Guide To UNIX Using Linux Third Edition
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
® Eurostep.ESUKPC v0.1©Copyright Eurostep Limited An Introduction to ISO STEP Part 25 David Price.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
OOPSLA 2003 DSM Workshop Diagram Definition Facilities Based on Metamodel Mappings Edgars Celms, Audris Kalnins, Lelde Lace University of Latvia, IMCS,
An Approach and Tool for Synchronous Refactoring of UML Diagrams and Models Using Model-to-Model Transformations Hafsteinn Þór Einarsson Helmut Neukirchen.
Imperative Programming
Faculty of Informatics and Information Technologies Slovak University of Technology Peter Kajsa and Ľubomír Majtás Design.
UML2 Package Merge Usage scenarios and their effect on XMI and Java API interoperability Bran Selic, Jim Amsden, Kenn Hussey Oct, 2003.
MDA and QVT  Tom Gullion, Director of Product Management, Together Products.
Profiling Metadata Specifications David Massart, EUN Budapest, Hungary – Nov. 2, 2009.
Introduction to MDA (Model Driven Architecture) CYT.
Agenda 1. Introduction 2. Overview of SU-MoVal 3. OCL-based Model Validation 4. QVT-based Transformations 5. Demo of SU-MoVal 6. Conclusion and Future.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
I T & S A e r o s p a c eD e f e n c e THALES Research & Technology THALES recommendations for the final OMG standard on Query / Views / Transformations.
More on “The Huddersfield Method” A lightweight, pattern-driven method based on SSM, Domain Driven Design and Naked Objects.
ISO/IEC CD and WD : Core Model and Model Mapping ISO/IEC JTC1/SC32/WG September 2005, Toronto SC32/WG2 Japan (Kanrikogaku Ltd) Masaharu.
Model Driven Development An introduction. Overview Using Models Using Models in Software Feasibility of MDA MDA Technologies The Unified Modeling Language.
1 SystemVerilog Enhancement Requests Daniel Schostak Principal Engineer February 26 th 2010.
More About Objects and Methods Chapter 5. Outline Programming with Methods Static Methods and Static Variables Designing Methods Overloading Constructors.
© Kenneth C. Louden, Chapter 11 - Functional Programming, Part III: Theory Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
IM NTU Software Development Methods, Fall2006 Software Development Methods, Fall 2006 OCL 2006/12/ Object Constraint Language (OCL) Yih-Kuen Tsay.
Object-Oriented Programming © 2013 Goodrich, Tamassia, Goldwasser1Object-Oriented Programming.
All Presentation Material Copyright Eurostep Group AB ® A Meta-model of EXPRESS in UML for MOF and UML to EXPRESS David Price April 2002.
ModTransf A Simple Model to Model Transformation Engine Cédric Dumoulin.
Chapter 10: Classes and Data Abstraction. Classes Object-oriented design (OOD): a problem solving methodology Objects: components of a solution Class:
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Interpreting the Object Constraint Presented by: Ed Kausmeyer.
Syntax Analysis Or Parsing. A.K.A. Syntax Analysis –Recognize sentences in a language. –Discover the structure of a document/program. –Construct (implicitly.
Defects of UML Yang Yichuan. For the Presentation Something you know Instead of lots of new stuff. Cases Instead of Concepts. Methodology instead of the.
Made available under EPL 1.0 Aligning OCL and UML Edward Willink Eclipse OCL Project Lead, Eclipse QVTd Project Lead, Thales OMG OCL RTF Representative,
OCL Specification Status
The Importance of Opposites
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
SysML-Modelica: A Redefinition & Modification Use Case
Operational QVT Incremental Update
Summary Report Project Name: Model-Driven Health Tools (MDHT)
SysML 2.0 Formalism Requirements and Potential Language Architectures
SysML 2.0 Formalism: Requirement Benefits, Use Cases, and Potential Language Architectures Formalism WG December 6, 2016.
SysML v2 Formalism: Requirements & Benefits
Behavioral Design Patterns
CS 326 Programming Languages, Concepts and Implementation
Arab Open University 2nd Semester, M301 Unit 5
September 4, 1997 Programming Languages (CS 550) Lecture 6 Summary Operational Semantics of Scheme using Substitution Jeremy R. Johnson TexPoint fonts.
Software Engineering: A Practitioner’s Approach, 6/e Chapter 11 Component-Level Design copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc.
Modeling the OCL Standard Library
Business Process Measures
Closures and Streams cs784(Prasad) L11Clos
Proposed SysML v2 Submission Plan
Chapter 10: Process Implementation with Executable Models
Java Programming Language
FP Foundations, Scheme In Text: Chapter 14.
PHP.
Class Diagrams.
Copyright 2007 Oxford Consulting, Ltd
QVT Operational 1.0 Ganymede Simultaneous Release Graduation Review
Object Oriented System Design Class Diagrams
Chengyu Sun California State University, Los Angeles
Generics, Lambdas and Reflection
Presentation transcript:

OCL 2.5 Plans Edward Willink OCL 2014 @ MODELS 2014 Willink Transformations Ltd Eclipse Foundation MMT Component co-Lead OCL Project Lead QVTd Project Lead QVTo Committer OMG (Model Driven Solutions) OCL 2.3, 2.4 (2.5) RTF Chair QVT 1.2, 1.3 RTF Chair OCL 2014 @ MODELS 2014 30th September 2014

Overview Background, OMG User visible changes Critical omission 'include'/'import', URI-qualification 'No' changes - reify implied functionality Templates, Lambdas, Reflection Easy changes - syntax sugar elseif, safe-navigation, collection completion, patterns Tooling changes Hard changes, XMI ... AS Modularity / extensibility / semantics / exposition 30-Sept-2014 OCL 2.5 Plans

Simple Black Box view of OCL U s e r OCL Concrete Syntax Standard Library Semantics Specification exposition imperfect Precise Concrete Syntax Grammar More functionality 30-Sept-2014 OCL 2.5 Plans

White Box view of OCL OCL Specification totally inadequate r OCL M o d e l s Concrete Syntax Loader Standard Library Abstract Syntax XMI Semantics Saver Specification totally inadequate Missing / Unimplementable Rewrite / Design 30-Sept-2014 OCL 2.5 Plans

Background to OCL 2.5 RFP OCL 1.x specified as part of UML 1.x specifies that parts that need formal words OCL 2.0 split off from UML 2.0 OCL useable in its own right No resources available to complete specification QVT 1.0 specified as an extension of OCL OCL 2.0 draft approved TBDs and all OCL 2.1/2.2, 2.3, 2.4 provides limited improvements consistency needs needs major editorial changes needs model-driven automation 30-Sept-2014 OCL 2.5 Plans

OMG Revision Revisions small fixes (Revision Task Force) issue, resolution, ballot, update, approval significant textual activity (one page/hour per typo) cannot have a 'replace entire chapter' resolution Submissions Request for Proposal Competing submissions ... merge/conflict/ballot final revision (Finalization Task Force) can make 100% change; it's a new specification 30-Sept-2014 OCL 2.5 Plans

OCL 2.5 RFP http://doc.omg.org/ad/2014-3-5 Rewrite the OCL specification Achieve the long overdue UML (2.5) alignment 'No' breakage of OCL as used in UML 2.5 OCL in UML 2.5 was checked with modern tooling Necessary changes to make OCL Abstract Syntax interchangeable in XMI resolve numerous magic/inconsistent areas Improve useability/extensibility 30-Sept-2014 OCL 2.5 Plans

OCL 2.5 Timeline Letter of Intent (LOI) deadline 10 November 2014 Initial Submission deadline 10 February 2015 Voter registration closes 20 February 2015 Initial Submission presentations 25 March 2015 Revised Submission deadline 18 May 2015 Revised Submission presentations 10 June 2015 ... Finalization Task Force ... ... ? approval late 2016 Prototyped in Eclipse OCL (Mars, June 2015) 30-Sept-2014 OCL 2.5 Plans

Critical Omissions - Model Import Complete OCL document complements what? implementation-specific solutions import 'mm-package-uri' import alias : 'mm-package-uri' library 'lib-package-uri' Essential OCL text is the dominant OCL persistence no import possible oclIsKindOf('package-uri'::MyType) first namespace qualifier may be a quoted URI 30-Sept-2014 OCL 2.5 Plans

Implied Functionality - Lambdas s->forAll(a, b | a + b <> 0) a+b<>0 specified in OCL 2.4 as a textual macro a+b<>0 is a lambda expression in OCL 2.5 library modeling needs a lambda type allow assignment to variables let f(p : Real, q : Real) = p + q <> 0 in s->forAll(a, b | f(a,b)) let f(p : Real, q : Real) : Lambda(p : Real, q : Real) : Boolean = p + q <> 0 in s->forAll(a : Real, b : Real | f(a,b)) no 'letrec' - forward lambda references allowed 30-Sept-2014 OCL 2.5 Plans

Implied Functionality - Templates Set(String) Set(T) collection types have a magic T in OCL 2.4 T is a type template parameter in OCL 2.5 supports UML templates templated types/operations but not packages/... parameterised by types/literals but not operations/... (T) rather than <T> in OCL expressions experimental use of <> had grammar challenges 30-Sept-2014 OCL 2.5 Plans

Implied Functionality - Reflection Classifier::allInstances() : Set(T) in OCL 2.4 OclAny::oclType() : Classifier in OCL 2.4 informal declarations, magic T MyType::allInstances().myProperty unspecified apparent type utility OclAny::oclType() : typeof(OclSelf) in OCL 2.5 OclAny::allInstances() : Set(OclSelf) in OCL 2.5 OclSelf - the apparent type of self typeof(X) - Class with instance lowerbound of X myType.oclType().ownedOperations 30-Sept-2014 OCL 2.5 Plans

Implied functionality - type construction object construction would be useful Tuple syntax re-useable Tuple{name:type=value} object construction has a side effect - not OCL def: f(n:String): MyType = MyType{n=name} inv: f('me') = f('me') constructions must create 'shared' object 'shadow' object construction is possible shadow is a Tuple with same named properties distinct Tuples equal by value real object created when exploited by QVT 30-Sept-2014 OCL 2.5 Plans

Implied functionality - multi-returns UML supports multiple function returns OCL 2.4 doesn't Solution, wrap multiple returns up as a Tuple 'UML': f(in a:A, in b:B, inout c:C, out d:D) becomes OCL: f(a:B, b:B, c:C) : Tuple{c:C, d:D} body: Tuple{c = ..., d = ...} post: result.c = ... post: result.d = ... post: result = Tuple{c = ..., d = ...} 30-Sept-2014 OCL 2.5 Plans

Syntax sugar - elseif OCL 2.4 cumbersome endifs OCL 2.5 simpler if c1 then v1 else if c2 then v2 else if c3 then v3 else v4 endif endif endif OCL 2.5 simpler if c1 then v1 elseif c2 then v2 elseif c3 then v3 else v4 endif just a CS rewrite 30-Sept-2014 OCL 2.5 Plans

Syntax sugar - typesafe if OCL 2.4 cumbersome re-typing if x.oclIsKindOf(MyType) then let t : MyType = x.oclAsType(MyType) in f(t) else ... endif OCL 2.5 simpler if t : MyType = x then f(t) else ... endif special case of a pattern match 30-Sept-2014 OCL 2.5 Plans

Syntax sugar - safe navigation OCL 2.4 vulnerable to navigation on nulls x.ys.z x.ys->collect(z) is invalid if x or any x.ys is null if x <> null then x.ys->excluding(null).z else null endif OCL 2.5 offers safe navigation x.?ys.?z x.?ys->?collect(z) simple CS rewrite 30-Sept-2014 OCL 2.5 Plans

Syntax sugar - iterator alternatives OCL 2.4 source->iteration(iterators | body) e.g. s->forAll(body) s->forAll(i | body) s->forAll(i : Integer | body) OCL 2.5 iterator may instead have domain forAll(i in s | body) forAll(i : Integer in s | body) OCL 2.5 iterator may be allInstances forAll(c in Class | body) Class::allInstances()->forAll(c | body) type/property ambiguity resolved to type 30-Sept-2014 OCL 2.5 Plans

Iteration co-indexes OCL 2.4 cumbersome to obtain iteration index parameters->forAll(p | let i = parameters->indexOf(p), a = arguments->at(i) in a.type->conformsTo(p.type)) For ordered collections parameters->forAll(p[i] | let a = arguments->at(i) in a.type->conformsTo(p.type)) Implementation can be better than syntax sugar add coIndexName to AS 30-Sept-2014 OCL 2.5 Plans

Syntax sugar - collection comprehension OCL 2.4 iterations source->iteration(iterator : T | body) OCL 2.5 iteration alternative with initializer iteration(iterator : T in source | body) OCL 2.4 collection literal Set{1, 4, 9, 16} OCL 2.5 collection comprehension Sequence{1..4}->Set{i | i*i} Set{i in Sequence{1..4} | i*i} rewrite of Sequence{1..4}->collect(i | i*i)->asSet() 30-Sept-2014 OCL 2.5 Plans

Syntax sugar - varargs OCL 2.4 invocation arguments must match f(a : Integer, b : String[*]) may be invoked as f(1, Set{'a'}) OCL 2.5 allows enumeration of final collection f(1) f(1, 'a') f(1, 'a', 'b') WFRs prohibit overload ambiguities 30-Sept-2014 OCL 2.5 Plans

Library - inadequate extensibility OCL 2.4 Standard Library - mandatory not a model, not referenceable, not extensible OCL 2.5 Standard Library - replaceable OCL Pivot model, referenceable, extensible open market to domain-specific libraries OCL 2.4 Monolith OCL 2.5 Modular, extensible at least States, Messages optional probably Reflection optional optional => tooling regeneration for changes 30-Sept-2014 OCL 2.5 Plans

Library - Map OCL 2.4 cumbersome inaccurate Set{Tuple} not Set{String} let myMap = Set{Tuple{key:String=...,value:Integer=...}} in myMap->includes{Tuple{key='five',value=5}) inaccurate Set{Tuple} not Set{String} OCL 2.5 Map (and OrderedMap) let myMap : Map(String,Integer) = ... in myMap->includes('five',5) Obvious, but not quite so obvious OCL-like coherent interface design welcome 30-Sept-2014 OCL 2.5 Plans

Library - selectCollect QVTo (imperative): source->xcollectselect(iterators; result := body | guard) OCL 2.5 source->selectCollect(iterators | guard | body) rewrite of source->select(iterators | guard)->collect(iterators | body) 30-Sept-2014 OCL 2.5 Plans

Complete OCL - Package invariants OCL 2.4 only classes have invariants all invariants must be allocated to a class OCL 2.5, packages may have invariants too package Mine inv PackageInvariant: .... 30-Sept-2014 OCL 2.5 Plans

A Use Case (1) All Classes have capitalized names OCL 2.4 correct context Class inv: let n = name.at(1) in n = n.toUpperCase() naive context Class inv: Class::allInstances()->forAll(c | let n = c.name.at(1) in n = n.toUpperCase()) OCL 2.5 better package UML inv: forAll(c in Class | c.name.isCapitalized()) 30-Sept-2014 OCL 2.5 Plans

A Use Case (2) New: iterator syntaxes forAll(c in Class ... package UML inv: forAll(c in Class | c.name.isCapitalized()) New: iterator syntaxes forAll(c in Class ... New: Package Invariants for global truths localizing allInstances() is an implementation detail Old: helper function (for library type) context String def: isCapitalized() : Boolean = let n = at(1) in n = n.toUpperCase() 30-Sept-2014 OCL 2.5 Plans

White Box view of OCL OCL Specification totally inadequate r OCL M o d e l s Concrete Syntax Loader Standard Library Abstract Syntax XMI Semantics Saver Specification totally inadequate Missing / Unimplementable Rewrite / Design 30-Sept-2014 OCL 2.5 Plans

XMI Model interchange - goals model state must be captured by objects no magic every state object must be referenceable no holes every state object must be persistable no non-derived secret objects persisted objects must be reloadable no irreversible conversions OCL-specific XMI loader/saver undesirable 30-Sept-2014 OCL 2.5 Plans

XMI Model interchange - OCL 2.4 model state must be captured by objects Iterations are not modelled Constraint does not exist in EMOF every state object must be referenceable Complete OCL objects have no URI OCL Standard Library elements have no URI every state object must be persistable Collection/Tuple specializations are unspecified persisted objects must be reloadable only if vendors provide a non-standard solution 30-Sept-2014 OCL 2.5 Plans

OCL principle and practice User Types Specification Types Specification-time, Metamodels don't care CMOF::Class Design-time, compile-time, User Models EClass, OCL-text, OCLExpression UML::Class, EMOF::Class, OCL::OCLExpression Run-time User Instances/Values EObject, int ObjectValue IntegerValue 30-Sept-2014 OCL 2.5 Plans

UML 2.0...2.4 Core::Basic Packages inelegant Class/Type singular superClass obsolete ownedAttribute vague root efficient 30-Sept-2014 OCL 2.5 Plans

UML 2.5 Packages same inelegancies new inefficiencies extra inheritances multi-level property subsets property redefinition property derivation 30-Sept-2014 OCL 2.5 Plans

OCL 2.5 Pivot User Types Specification Types align Specification-time, Metamodels UML::Class OCL::Class MtoM MtoM Pivot load Design-time, compile-time, User Models EClass, OCL-text, OCLExpression OCL::Class, OCL::OCLExpression MtoM semantics Run-time User Instances/Values EObject, int ObjectValue IntegerValue MtoM 30-Sept-2014 OCL 2.5 Plans

Specification Time MtoM From: UML 2.5 metamodel OCL 2.5 metamodel (optional vendor-specific metamodel) Using QVTo transformation, Control Model delete/merge/rename/redefine Package/Class/... To: OCL Pivot metamodel e.g. Type,Classifier,Class => Class Class::ownedAttribute => Class::ownedProperties 30-Sept-2014 OCL 2.5 Plans

Compile Time MtoM Load UML/EMOF/Ecore/... Model(s) OCL Standard Library Model(s) User Complete OCL Document(s) Normalize to OCL Pivot Model unified PrimitiveTypes unified synthetic types (Collections, Tuples) conformance/inheritance of OclAny/OclElement complete classes make unnavigable opposites navigable determine stereotype properties 30-Sept-2014 OCL 2.5 Plans

Run time 'MtoM' Conversion to Pivot Values inefficient Run-time mapping defines observable semantics Simple OCL just executes Type-dependent expressions either map Pivot conformance to user type system or map user type system to Pivot conformance Reflection load user type system as Pivot model reflection uses Pivot model 30-Sept-2014 OCL 2.5 Plans

Objects to Reference EssentialOCL is the package exposing the minimal OCL required to work with EMOF no Constraint or OpaqueExpression then Note - It is expected that further revisions of this specification will provide explicitly the complete set of well-formedness rules and additional operations that apply to Core::Basic - to replace the lazy re-interpretation statement we are using here. UML 2.5 removes Core::Basic 30-Sept-2014 OCL 2.5 Plans

Metamodel goals UML - analysis / design powerful metamodeling capabilities inefficient, not executed EMOF (or Ecore) - run-time / execution essential metamodeling capabilities efficient OCL - executable specification rich metamodeling capabilities efficient, executable 30-Sept-2014 OCL 2.5 Plans

OCL '2.5' Partial Packages plural, consistent names ownedProperties explicit root efficient ownedClasses Type only for templates no subsets no redefinition no primary derivation 30-Sept-2014 OCL 2.5 Plans

OCL '2.5' Complete Packages 30-Sept-2014 OCL 2.5 Plans

OCL '2.5' Complete Packages primary derived properties additional helpful all-models derived properties e.g. context CompleteModel def: allClasses : Set(Class) = partialModels->closure(ownedPackages).ownedClasses potentially very efficient caches for derivations constant time name lookup operation overload lookup conformance type test 30-Sept-2014 OCL 2.5 Plans

Inadequate OCL 2.4 AS Open classes - Complete OCL extensions Constraints Lambda Types Reflection Iterations 30-Sept-2014 OCL 2.5 Plans

Inadequate UML alignment templates bounded collections non-navigable opposites qualified associations stereotype navigation operation overloading OclAny conformance 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (7) Clause 7 - tutorial, overview unfortunate number of mistakes Extract as a companion volume authors wanted ensure examples are tool checked 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (8) Clause 8 - Abstract Syntax unforgivable number of mistakes '8a' Auto-generate from Pivot Models including all the Class, CompleteClass, ... '8b' Use of OCL Constraint in UML '8c' compile time MtoM (loading/normalization) 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (9) Clause 9 - Concrete Syntax, Grammar elusive grammar, optimistic disambiguation '9a' Essential OCL: Auto-generate CS from CS Models grammar from 'Xtext' models CS2AS from CS2AS models disambiguation from CS2CS models lookup from Lookup models '9b' Same again for Complete OCL 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (10) Clause 10 - Semantics unforgivable number of mistakes Auto-generate from semantics structural Models 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (11) Clause 11 - OCL Standard Library inconsistent Auto-generate from OCL Standrad Library model 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (11) Clause 11 - OCL Standard Library inconsistent Auto-generate from OCL Standrad Library model 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (12) Clause 12 - Use Of OCL in UML inconsistent, very incomplete Reorganise Complete OCL AS => Clause 8 Complete OCL CS/grammar => Clause '9b' OCL in UML=> Clause '12a' 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (13) Clause 13 - Basic OCL, Essential OCL largely a fairy story Rewrite specification time MtoM (UML alignment) 30-Sept-2014 OCL 2.5 Plans

Inadequate Exposition (A) Annex A - Formal Semantics LaTeX => FrameMaker corruptions Out of date: OrderedSet, closure(), ... Needs: templates, lambdas, ... Rewrite using Isabelle semantics companion document using LaTeX not necessarily 100% of language 30-Sept-2014 OCL 2.5 Plans

Summary OCL 2.5 rewrite, 'no-change', auto-generated from models UML-aligned bounded collections modeling requires formality lambdas, templates, reflection enhanced concrete syntax elseif, safe-navogation, ... defined load/save activties interchangeable abstract syntax via XMI extensible 30-Sept-2014 OCL 2.5 Plans

OCL specification claims (1) OCL 'works with UML' UML 2.0...2.4 Core::Basic perhaps UML 2.5 inefficient no Complete classes OCL 'works with EMOF' no OpaqueExpression - Constraints no unnavigable opposites no stereotypes no templates .... 30-Sept-2014 OCL 2.5 Plans

OCL specification claims (2) OCL 'is aligned with UML' 'aligned' not 'identical to' Recreate UML 2.4 Core::Basic from UML 2.5 use a QVTo Model-to-Model transformation correct unhelpful aspects add specified OCL 2.4 aspects add solutions to un/under-specified aspects 30-Sept-2014 OCL 2.5 Plans