SlideShare ist ein Scribd-Unternehmen logo
1 von 56
OCL 2.5 Plans 
Edward Willink 
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 
Made available under EPL 1.0
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 Made available under EPL 1.0 2
Simple Black Box view of OCL 
OCL 
Concrete Syntax 
Standard Library 
Semantics 
Users 
Specification exposition imperfect 
Precise Concrete Syntax Grammar 
More functionality 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 3
White Box view of OCL 
OCL 
Concrete Syntax 
Standard Library 
Semantics 
Users 
Loader 
Abstract 
Syntax 
Saver 
Specification totally inadequate 
Missing / Unimplementable 
Rewrite / Design 
Models 
XMI 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 4
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 Made available under EPL 1.0 5
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 Made available under EPL 1.0 6
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 Made available under EPL 1.0 7
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 Made available under EPL 1.0 8
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 Made available under EPL 1.0 9
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 Made available under EPL 1.0 10
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 Made available under EPL 1.0 11
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 Made available under EPL 1.0 12
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 Made available under EPL 1.0 13
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 Made available under EPL 1.0 14
Syntax sugar - elseif 
OCL 2.4 cumbersome endifs 
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 Made available under EPL 1.0 15
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 Made available under EPL 1.0 16
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 Made available under EPL 1.0 17
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 Made available under EPL 1.0 18
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 Made available under EPL 1.0 19
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 Made available under EPL 1.0 20
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 Made available under EPL 1.0 21
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 Made available under EPL 1.0 22
Library - Map 
OCL 2.4 cumbersome 
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 Made available under EPL 1.0 23
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 Made available under EPL 1.0 24
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 Made available under EPL 1.0 25
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 Made available under EPL 1.0 26
A Use Case (2) 
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 Made available under EPL 1.0 27
White Box view of OCL 
OCL 
Concrete Syntax 
Standard Library 
Semantics 
Users 
Loader 
Abstract 
Syntax 
Saver 
Specification totally inadequate 
Missing / Unimplementable 
Rewrite / Design 
Models 
XMI 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 29
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 Made available under EPL 1.0 30
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 Made available under EPL 1.0 31
OCL principle and practice 
Specification-time, 
Metamodels 
Design-time, 
compile-time, 
User Models 
Run-time User 
Instances/Values 
User Types Specification Types 
don't care CMOF::Class 
EClass, 
OCL-text, 
OCLExpression 
EObject, 
int 
UML::Class, 
EMOF::Class, 
OCL::OCLExpression 
ObjectValue 
IntegerValue 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 32
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 Made available under EPL 1.0 33
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 Made available under EPL 1.0 34
OCL 2.5 Pivot 
Specification-time, 
Metamodels 
Design-time, 
compile-time, 
User Models 
Run-time User 
Instances/Values 
User Types Specification Types 
align 
UML::Class OCL::Class 
EClass, 
OCL-text, 
OCLExpression 
EObject, 
int 
Pivot 
OCL::Class, 
OCL::OCLExpression 
ObjectValue 
IntegerValue 
MtoM 
load 
MtoM 
semantics 
MtoM 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 35
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 Made available under EPL 1.0 36
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 Made available under EPL 1.0 37
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 Made available under EPL 1.0 38
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 Made available under EPL 1.0 39
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 Made available under EPL 1.0 40
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 Made available under EPL 1.0 41
OCL '2.5' Complete Packages 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 42
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 Made available under EPL 1.0 43
Inadequate OCL 2.4 AS 
Open classes - Complete OCL extensions 
Constraints 
Lambda Types 
Reflection 
Iterations 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 44
Inadequate UML alignment 
templates 
bounded collections 
non-navigable opposites 
qualified associations 
stereotype navigation 
operation overloading 
OclAny conformance 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 45
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 Made available under EPL 1.0 46
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 Made available under EPL 1.0 47
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 Made available under EPL 1.0 48
Inadequate Exposition (10) 
Clause 10 - Semantics 
unforgivable number of mistakes 
Auto-generate 
from semantics structural Models 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 49
Inadequate Exposition (11) 
Clause 11 - OCL Standard Library 
inconsistent 
Auto-generate 
from OCL Standrad Library model 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 50
Inadequate Exposition (11) 
Clause 11 - OCL Standard Library 
inconsistent 
Auto-generate 
from OCL Standrad Library model 
30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 51
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 Made available under EPL 1.0 52
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 Made available under EPL 1.0 53
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 Made available under EPL 1.0 54
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 Made available under EPL 1.0 55
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 Made available under EPL 1.0 56
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 Made available under EPL 1.0 57

Weitere ähnliche Inhalte

Was ist angesagt?

A peek on numerical programming in perl and python e christopher dyken 2005
A peek on numerical programming in perl and python  e christopher dyken  2005A peek on numerical programming in perl and python  e christopher dyken  2005
A peek on numerical programming in perl and python e christopher dyken 2005
Jules Krdenas
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVM
Linaro
 

Was ist angesagt? (20)

Mit cilk
Mit cilkMit cilk
Mit cilk
 
Compiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationCompiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code Generation
 
A peek on numerical programming in perl and python e christopher dyken 2005
A peek on numerical programming in perl and python  e christopher dyken  2005A peek on numerical programming in perl and python  e christopher dyken  2005
A peek on numerical programming in perl and python e christopher dyken 2005
 
An evaluation of LLVM compiler for SVE with fairly complicated loops
An evaluation of LLVM compiler for SVE with fairly complicated loopsAn evaluation of LLVM compiler for SVE with fairly complicated loops
An evaluation of LLVM compiler for SVE with fairly complicated loops
 
Code optimization
Code optimizationCode optimization
Code optimization
 
GCC, GNU compiler collection
GCC, GNU compiler collectionGCC, GNU compiler collection
GCC, GNU compiler collection
 
Compiler unit 5
Compiler  unit 5Compiler  unit 5
Compiler unit 5
 
GCC
GCCGCC
GCC
 
Symbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesSymbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo Theories
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVM
 
Al2ed chapter17
Al2ed chapter17Al2ed chapter17
Al2ed chapter17
 
Java 8
Java 8Java 8
Java 8
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Unit iv(simple code generator)
Unit iv(simple code generator)Unit iv(simple code generator)
Unit iv(simple code generator)
 
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
 
Compiler unit 2&3
Compiler unit 2&3Compiler unit 2&3
Compiler unit 2&3
 
Taking Kotlin to production, Seriously
Taking Kotlin to production, SeriouslyTaking Kotlin to production, Seriously
Taking Kotlin to production, Seriously
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
A Simple Communication System Design Lab #4 with MATLAB Simulink
A Simple Communication System Design Lab #4 with MATLAB SimulinkA Simple Communication System Design Lab #4 with MATLAB Simulink
A Simple Communication System Design Lab #4 with MATLAB Simulink
 

Andere mochten auch

La &amp; edm in practice
La &amp; edm in practiceLa &amp; edm in practice
La &amp; edm in practice
bharati k
 
Prfc rhapsody simulation_1.0
Prfc rhapsody simulation_1.0Prfc rhapsody simulation_1.0
Prfc rhapsody simulation_1.0
Pascal Roques
 
mis
mismis
mis
ISIG
 
01072013 e governance
01072013 e governance01072013 e governance
01072013 e governance
bharati k
 
Environnement de développement de bases de données
Environnement de développement de bases de donnéesEnvironnement de développement de bases de données
Environnement de développement de bases de données
ISIG
 
Vbisigk
VbisigkVbisigk
Vbisigk
ISIG
 
SysML adoption in France
SysML adoption in FranceSysML adoption in France
SysML adoption in France
Pascal Roques
 

Andere mochten auch (20)

Modeling the OCL Standard Library
Modeling the OCL Standard LibraryModeling the OCL Standard Library
Modeling the OCL Standard Library
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
 
Ressource numérique Circuit électrique au primaire
Ressource numérique Circuit électrique au primaire Ressource numérique Circuit électrique au primaire
Ressource numérique Circuit électrique au primaire
 
La &amp; edm in practice
La &amp; edm in practiceLa &amp; edm in practice
La &amp; edm in practice
 
Prfc rhapsody simulation_1.0
Prfc rhapsody simulation_1.0Prfc rhapsody simulation_1.0
Prfc rhapsody simulation_1.0
 
UMLX and QVT and ATL
UMLX and QVT and ATLUMLX and QVT and ATL
UMLX and QVT and ATL
 
mis
mismis
mis
 
Cvl
CvlCvl
Cvl
 
Timing verification of automotive communication architecture using quantile ...
Timing verification of automotive communication  architecture using quantile ...Timing verification of automotive communication  architecture using quantile ...
Timing verification of automotive communication architecture using quantile ...
 
Aligning OCL and UML
Aligning OCL and UMLAligning OCL and UML
Aligning OCL and UML
 
01072013 e governance
01072013 e governance01072013 e governance
01072013 e governance
 
Environnement de développement de bases de données
Environnement de développement de bases de donnéesEnvironnement de développement de bases de données
Environnement de développement de bases de données
 
Vbisigk
VbisigkVbisigk
Vbisigk
 
Fast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast QueriesFast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast Queries
 
SysML adoption in France
SysML adoption in FranceSysML adoption in France
SysML adoption in France
 
Frame latency evaluation: when simulation and analysis alone are not enough
Frame latency evaluation: when simulation and analysis alone are not enoughFrame latency evaluation: when simulation and analysis alone are not enough
Frame latency evaluation: when simulation and analysis alone are not enough
 
OCCIware
OCCIwareOCCIware
OCCIware
 
النشاط العلمي - الكهرباء
النشاط العلمي  -   الكهرباءالنشاط العلمي  -   الكهرباء
النشاط العلمي - الكهرباء
 
OCL Integration and Code Generation
OCL Integration and Code GenerationOCL Integration and Code Generation
OCL Integration and Code Generation
 
The OCLforUML Profile
The OCLforUML ProfileThe OCLforUML Profile
The OCLforUML Profile
 

Ähnlich wie OCL 2.5 plans

Enriching your models with OCL
Enriching your models with OCLEnriching your models with OCL
Enriching your models with OCL
University of York
 
Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.
Alexandro Colorado
 

Ähnlich wie OCL 2.5 plans (20)

OCL 2019 Keynote Retrospective and Prospective
OCL 2019 Keynote Retrospective and ProspectiveOCL 2019 Keynote Retrospective and Prospective
OCL 2019 Keynote Retrospective and Prospective
 
O caml2014 leroy-slides
O caml2014 leroy-slidesO caml2014 leroy-slides
O caml2014 leroy-slides
 
OCL Specification Status
OCL Specification StatusOCL Specification Status
OCL Specification Status
 
Safe navigation in OCL
Safe navigation in OCLSafe navigation in OCL
Safe navigation in OCL
 
Re-engineering Eclipse MDT/OCL for Xtext
Re-engineering Eclipse MDT/OCL for XtextRe-engineering Eclipse MDT/OCL for Xtext
Re-engineering Eclipse MDT/OCL for Xtext
 
Embedded OCL Integration and Debugging
Embedded OCL Integration and DebuggingEmbedded OCL Integration and Debugging
Embedded OCL Integration and Debugging
 
OCL in EMF
OCL in EMFOCL in EMF
OCL in EMF
 
Eclipse OCL Summary
Eclipse OCL SummaryEclipse OCL Summary
Eclipse OCL Summary
 
An OCL Map Type
An OCL Map TypeAn OCL Map Type
An OCL Map Type
 
Kotlin- Basic to Advance
Kotlin- Basic to Advance Kotlin- Basic to Advance
Kotlin- Basic to Advance
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
 
UML: Once More with Meaning
UML: Once More with MeaningUML: Once More with Meaning
UML: Once More with Meaning
 
Enriching your models with OCL
Enriching your models with OCLEnriching your models with OCL
Enriching your models with OCL
 
At Last an OCL Debugger
At Last an OCL DebuggerAt Last an OCL Debugger
At Last an OCL Debugger
 
Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.
 
python.ppt
python.pptpython.ppt
python.ppt
 
OCL - The Bigger Picture
OCL - The Bigger PictureOCL - The Bigger Picture
OCL - The Bigger Picture
 
Functional Programming in Scala: Notes
Functional Programming in Scala: NotesFunctional Programming in Scala: Notes
Functional Programming in Scala: Notes
 
iptables and Kubernetes
iptables and Kubernetesiptables and Kubernetes
iptables and Kubernetes
 
Intro to Open Babel
Intro to Open BabelIntro to Open Babel
Intro to Open Babel
 

Mehr von Edward Willink

Mehr von Edward Willink (14)

OCL Visualization A Reality Check
OCL Visualization A Reality CheckOCL Visualization A Reality Check
OCL Visualization A Reality Check
 
A text model - Use your favourite M2M for M2T
A text model - Use your favourite M2M for M2TA text model - Use your favourite M2M for M2T
A text model - Use your favourite M2M for M2T
 
Shadow Objects
Shadow ObjectsShadow Objects
Shadow Objects
 
Commutative Short Circuit Operators
Commutative Short Circuit OperatorsCommutative Short Circuit Operators
Commutative Short Circuit Operators
 
Deterministic Lazy Mutable OCL Collections
Deterministic Lazy Mutable OCL CollectionsDeterministic Lazy Mutable OCL Collections
Deterministic Lazy Mutable OCL Collections
 
The Micromapping Model of Computation
The Micromapping Model of ComputationThe Micromapping Model of Computation
The Micromapping Model of Computation
 
Optimized declarative transformation First Eclipse QVTc results
Optimized declarative transformation First Eclipse QVTc resultsOptimized declarative transformation First Eclipse QVTc results
Optimized declarative transformation First Eclipse QVTc results
 
Local Optimizations in Eclipse QVTc and QVTr using the Micro-Mapping Model of...
Local Optimizations in Eclipse QVTc and QVTr using the Micro-Mapping Model of...Local Optimizations in Eclipse QVTc and QVTr using the Micro-Mapping Model of...
Local Optimizations in Eclipse QVTc and QVTr using the Micro-Mapping Model of...
 
The Importance of Opposites
The Importance of OppositesThe Importance of Opposites
The Importance of Opposites
 
QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?
 
Yet Another Three QVT Languages
Yet Another Three QVT LanguagesYet Another Three QVT Languages
Yet Another Three QVT Languages
 
Model Transformation A Personal Perspective
Model Transformation A Personal PerspectiveModel Transformation A Personal Perspective
Model Transformation A Personal Perspective
 
Enrich Your Models With OCL
Enrich Your Models With OCLEnrich Your Models With OCL
Enrich Your Models With OCL
 
Enriching Your Models with OCL
Enriching Your Models with OCLEnriching Your Models with OCL
Enriching Your Models with OCL
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Kürzlich hochgeladen (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

OCL 2.5 plans

  • 1. OCL 2.5 Plans Edward Willink 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 Made available under EPL 1.0
  • 2. 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 Made available under EPL 1.0 2
  • 3. Simple Black Box view of OCL OCL Concrete Syntax Standard Library Semantics Users Specification exposition imperfect Precise Concrete Syntax Grammar More functionality 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 3
  • 4. White Box view of OCL OCL Concrete Syntax Standard Library Semantics Users Loader Abstract Syntax Saver Specification totally inadequate Missing / Unimplementable Rewrite / Design Models XMI 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 4
  • 5. 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 Made available under EPL 1.0 5
  • 6. 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 Made available under EPL 1.0 6
  • 7. 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 Made available under EPL 1.0 7
  • 8. 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 Made available under EPL 1.0 8
  • 9. 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 Made available under EPL 1.0 9
  • 10. 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 Made available under EPL 1.0 10
  • 11. 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 Made available under EPL 1.0 11
  • 12. 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 Made available under EPL 1.0 12
  • 13. 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 Made available under EPL 1.0 13
  • 14. 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 Made available under EPL 1.0 14
  • 15. Syntax sugar - elseif OCL 2.4 cumbersome endifs 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 Made available under EPL 1.0 15
  • 16. 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 Made available under EPL 1.0 16
  • 17. 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 Made available under EPL 1.0 17
  • 18. 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 Made available under EPL 1.0 18
  • 19. 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 Made available under EPL 1.0 19
  • 20. 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 Made available under EPL 1.0 20
  • 21. 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 Made available under EPL 1.0 21
  • 22. 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 Made available under EPL 1.0 22
  • 23. Library - Map OCL 2.4 cumbersome 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 Made available under EPL 1.0 23
  • 24. 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 Made available under EPL 1.0 24
  • 25. 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 Made available under EPL 1.0 25
  • 26. 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 Made available under EPL 1.0 26
  • 27. A Use Case (2) 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 Made available under EPL 1.0 27
  • 28. White Box view of OCL OCL Concrete Syntax Standard Library Semantics Users Loader Abstract Syntax Saver Specification totally inadequate Missing / Unimplementable Rewrite / Design Models XMI 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 29
  • 29. 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 Made available under EPL 1.0 30
  • 30. 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 Made available under EPL 1.0 31
  • 31. OCL principle and practice Specification-time, Metamodels Design-time, compile-time, User Models Run-time User Instances/Values User Types Specification Types don't care CMOF::Class EClass, OCL-text, OCLExpression EObject, int UML::Class, EMOF::Class, OCL::OCLExpression ObjectValue IntegerValue 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 32
  • 32. 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 Made available under EPL 1.0 33
  • 33. 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 Made available under EPL 1.0 34
  • 34. OCL 2.5 Pivot Specification-time, Metamodels Design-time, compile-time, User Models Run-time User Instances/Values User Types Specification Types align UML::Class OCL::Class EClass, OCL-text, OCLExpression EObject, int Pivot OCL::Class, OCL::OCLExpression ObjectValue IntegerValue MtoM load MtoM semantics MtoM 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 35
  • 35. 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 Made available under EPL 1.0 36
  • 36. 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 Made available under EPL 1.0 37
  • 37. 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 Made available under EPL 1.0 38
  • 38. 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 Made available under EPL 1.0 39
  • 39. 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 Made available under EPL 1.0 40
  • 40. 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 Made available under EPL 1.0 41
  • 41. OCL '2.5' Complete Packages 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 42
  • 42. 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 Made available under EPL 1.0 43
  • 43. Inadequate OCL 2.4 AS Open classes - Complete OCL extensions Constraints Lambda Types Reflection Iterations 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 44
  • 44. Inadequate UML alignment templates bounded collections non-navigable opposites qualified associations stereotype navigation operation overloading OclAny conformance 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 45
  • 45. 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 Made available under EPL 1.0 46
  • 46. 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 Made available under EPL 1.0 47
  • 47. 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 Made available under EPL 1.0 48
  • 48. Inadequate Exposition (10) Clause 10 - Semantics unforgivable number of mistakes Auto-generate from semantics structural Models 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 49
  • 49. Inadequate Exposition (11) Clause 11 - OCL Standard Library inconsistent Auto-generate from OCL Standrad Library model 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 50
  • 50. Inadequate Exposition (11) Clause 11 - OCL Standard Library inconsistent Auto-generate from OCL Standrad Library model 30-Sept-2014 OCL 2.5 Plans Made available under EPL 1.0 51
  • 51. 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 Made available under EPL 1.0 52
  • 52. 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 Made available under EPL 1.0 53
  • 53. 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 Made available under EPL 1.0 54
  • 54. 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 Made available under EPL 1.0 55
  • 55. 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 Made available under EPL 1.0 56
  • 56. 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 Made available under EPL 1.0 57