SlideShare une entreprise Scribd logo
1  sur  119
Enrich Your Models with OCL Edward Willink,  Thales MDT/OCL Project Lead Axel Uhl,  SAP 21st March 2011
Part 1: OCL in isolation Installation Instructions OCL Basic Principles exercises OCL Collections and Iterators exercises OCL tools and usage exercises OCL in Java - analyzable language
Part 2: OCL beyond OCL State Machine Example ,[object Object]
OCLinEcore - integrated validation language exercises ,[object Object],[object Object],[object Object],[object Object]
Tutorial Material ,[object Object],http://www.eclipsecon.org/2011/sessions/?page=sessions&id=2271 ,[object Object]
link to a ZIP of ZIPs (only one file allowed) ,[object Object],[object Object],(http:// www.eclipse.org /modeling/mdt/ocl/docs/publications/EclipseCon2011Tutorial/MainWorkspaceProjects.zip) ,[object Object],(http://www.eclipse.org/modeling/mdt/ocl/docs/publications/EclipseCon2011Tutorial/RuntimeWorkspaceProjects.zip) ,[object Object]
Preparation - Indigo M6 Platform ,[object Object],[object Object],[object Object],C:oolsclipse.7M6EclipseConclipse.exe   -data C:/EclipseCon/Workspace -vmargs -Xmx1g   -XX:PermSize=64M -XX:MaxPermSize=128M
Preparation - Indigo M6 Projects ,[object Object],Indigo - http://download.eclipse.org/releases/indigo (after 18 Mar)  Indigo - http://download.eclipse.org/releases/staging (before) ,[object Object]
Modeling->Graphical Modeling Framework (GMF) Runtime
Modeling->OCL Examples and Editors
Modeling->Operational QVT SDK
Modeling->UML2 Extender SDK ,[object Object],[object Object],[object Object]
Next ... Restart Now
Preparation - Indigo M6a Updates ,[object Object]
no help for adverse SWT/Modeling interaction  ,[object Object],http://download.eclipse.org/modeling/mdt/ocl/updates/milestones or USB stick:  mdt-ocl-Update-3.1.0M6a.zip ,[object Object]
Preparation - Main Workspace ,[object Object]
Next ,[object Object],http://www.eclipse.org/modeling/mdt/ocl/docs/publications/EclipseCon2011Tutorial/MainWorkspaceProjects.zip ,[object Object]
0 errors
98 warnings
Preparation - Runtime Eclipse ,[object Object],-Xms40m -Xmx512m   -XX:PermSize=64M -XX:MaxPermSize=128M ,[object Object]
Select the "Arguments" tab ,[object Object],[object Object]
Preparation - Runtime Workspace ,[object Object]
Next ,[object Object],[object Object]
2 errors
3 warnings
Models ,[object Object],[object Object],[object Object],[object Object]
Xtext editors ,[object Object],[object Object]
Rules ,[object Object]
password must contain only letters and numbers ,[object Object],[object Object]
semantic validation for complex rules ,[object Object],[object Object],[object Object],[object Object]
Behaviors ,[object Object]
changes occur ,[object Object],[object Object],[object Object]
M2M: OMG QVT, Eclipse QVTo, ATL, Epsilon
M2T: OMG MOFM2T, Eclipse Acceleo
Object Constraint Language ,[object Object],[object Object]
Simple Meta-Modeling Graphics ,[object Object],Text ,[object Object]
Multiplicity Example Family Tree Meta-Model Ecore Diagram (similar to UML Class Diagram)
Richer Meta-Modelling ,[object Object]
MALE/FEMALE gender ,[object Object]
1 MALE, 1 FEMALE parent
Self is not  an ancestor  of self
Example Family Tree Model Simple GMF Diagram Editor Runtime Workspace: ESEExampleTree/model/default.people_diagram
Simple Query Evaluation Window->Show View->Other... Console Console: New: Interactive Xtext OCL Select  Zeus  as the Model Context (in any model editor) Type  children  then carriage return
OCL Principles ,[object Object],∀ x ∈ y ∃ z(x) ,[object Object]
side effect free, no model changes, atomic execution
strongly typed, using UML generalization
Primitive Types and Literals Java (implementation) OCL (specification) boolean,Boolean,true,false Boolean,true,false short,int,long,Integer,BigInteger Integer , UnlimitedNatural float, double, BigDecimal Real Character, String, 'c',  " line " String, 'c',  ' line ' Object,this,null OclAny, self ,null Exception invalid Integer value value : Integer Java: practical implementation language OCL: simpler, idealistic, specification language
Mathematical Operators Java (implementation) OCL (specification) +, -, *, / +, -, *, / !, &&, ||, ^ not, and, or, xor, implies <, >, <=, >= <, >, <=, >= ==, != = , <> Math.max(4,5) 4.max(5) if  (a) b  else  c; if  a  then  b  else  c  endif Integer value = 5; doSomething(value); let  value : Integer = 5 in  doSomething(value)
More Complex Query Selecting  Hera  defines the implicit context variable self : Person =  Hera
Object Navigation Properties ,[object Object],Operations ,[object Object]
OCL in context ,[object Object]
adds values to model usage ,[object Object],[object Object],[object Object]
transforms the capabilties ,[object Object]
EMF Delegates (Helios) ,[object Object],[object Object]
Setting Delegate for EStructuralFeature initial value
Example Validation Delegate
The OCLinEcore Editor OCLinEcore editor maintains EAnnotations automatically OCLinEcore editor provides OCL syntax checking OCLinEcore editor will provide OCL semantic checking
OCLinEcore Editor ,[object Object]
Save As *.ecore ,[object Object],[object Object],[object Object],[object Object],[object Object]
Searchable/replaceable text
Example Validation Failure Open ESEExampleTree/model/People1.xmi in Main Eclipse, with Sample Reflective Ecore Editor Select Universe, Right button menu, Validate
Evaluator, OCLinEcore exercises ,[object Object]
determine the number of letters in Hephaestus ,[object Object],[object Object],[object Object]
revalidate
Multiplicities and Collections Meta-models specify multiplicities ,[object Object]
parents : Person[0..2] {unique} ,[object Object],Implementations (e.g. Ecore) reify multiplicities ,[object Object]
getChildren().get(2)  getChildren().add(newChild) OCL needs more than just UML multiplicities
OCL 2.0 Collections Typed Collections partially reify multiplicities Collections are different to objects Navigation from a Collection uses  -> ,[object Object],Collections have type parameters Collections have useful operations Collections have very useful iterations Collections are immutable Collection(T) Unordered Ordered Non-Unique Bag(T) Sequence(T) Unique Set(T) OrderedSet(T)
Example Collection Operations Collection::size()  self.children->size() 'get' Sequence::at(Integer)  self.children->at(1) ,[object Object],'add' Collection(T)::including(T) : Collection(T) ,[object Object],'contains' Collection(T)::includes(T) : Boolean ,[object Object]
Collection::select iteration ,[object Object],self.children ,[object Object],self.children->select(gender = Gender::MALE) self.children->select(child | child.gender = Gender::MALE) self.children->select(child : Person | child.gender = Gender::MALE) ,[object Object]
Collection::collect iteration ,[object Object],self.children ,[object Object],self.children->collect(children) self.children->collect(child | child.children) self.children->collect(child : Person | child.children) ,[object Object],[object Object]
OCL Navigation Operators anObject.  ...  object navigation aCollection->  ...  collection navigation Shorthands aCollection.  ...  implicit collect anObject->  ...  implicit as set Object Collection . Navigation ? -> ? Navigation
Implicit Collect Query parents.parents = parents->collect(parents) 3 symbols, compared to 4 lines of Java 4 grandparents, but not all different!
Cleaned up query parents.parents->asSet()->sortedBy(name) ->asSet()  converts to Set(Person), removes duplicates ->sortedBy(name)  alphabeticizes
Implicit As Set Conversion self->notEmpty() ,[object Object]
If  self  is a defined object ,[object Object],[object Object],[object Object],[object Object],[object Object],Object Collection . Navigation Implicit collect() -> Implicit as set Navigation
Collection::closure iteration ,[object Object],self->closure(children) ,[object Object],[ closure in MDT/OCL 1.2, in OMG OCL 2.3 ]
OCL as Implementation any(x)  iteration selects an arbitrary element for which x is true.
Derived Properties For Hera invariant   MixedGenderParents:  father . gender  <>  mother . gender ; fails because father is  null  and mother is  null
Collection exercises
Other OCL Capabilities No time to mention ,[object Object]
Tuples
Association Classes/Qualifiers
@pre values
Messages
States
OCL in Code - Java API ,[object Object]
evaluating OCL
Facade to hide internals
'Internal' API for derived language parse/evaluate  ,[object Object],[object Object],[object Object],[object Object]
The Re-Evaluation Problem ,[object Object]
System comprising a set of model elements
A model element changes ....
Which of the OCL expressions may have changed its value on which context elements?
Naïve approach ,[object Object]
takes O(|expressions| * |modelElements|)
The Impact Analyzer ,[object Object],[object Object]
re-evaluate ,[object Object]
only expression for which model element is changed Go to Efficient, Scalable Notification Handling for EMF (2 hours ago).
Benchmark Context Reduction (Average Case) Naive Event-Filtered (*6 Speed-Up) Event-Filtered and Context-Reduced (*1300 Speed-Up vs. Naive, *220 vs. Event-Filtered-Only) Total Re-Evaluation Time in Seconds Number of Model Elements
Benchmark Context Reduction (Worst Case) Naive Event-Filtered (*2.4 Speed-Up) Event-Filtered and Context-Reduced (*27 Speed-Up vs. Naive, *11 vs. Event-Filtered-Only) Total Re-Evaluation Time in Seconds Number of Model Elements (apply changes to very central elements, referenced by all other model packages)
State Machine Example ,[object Object]
OCLinEcore to avoid OCL getting lost ,[object Object]
Use QVTo and OCL to flatten state machine
Xtext with independent OCL Main Eclipse ,[object Object],[object Object]
Tailor Editor
Generate States Editor ,[object Object],Run-time Eclipse ,[object Object],[object Object]
Start Run-time
Edit  simple.states ,[object Object]
Start Run-time
Edit  simple.states ,[object Object]
Simple State Machine DSL module   &quot;simple.states&quot; statemachine  Machine { events  START STOP; state  Start { STOP  => Stop } initial   state  Stop  { START => Start }  }
The Xtext States Grammar http://www.eclipse.org/modeling/mdt/ocl/docs/publications/EclipseCon2011Tutorial /org.eclipse.ocl.tutorial.eclipsecon2011.states/src/org/eclipse/ocl/tutorial/eclipsecon2011/States.xtext grammar  org.eclipse.ocl.tutorial.eclipsecon2011.States with  org.eclipse.xtext.common.Terminals generate  states  &quot;http://ocl.eclipse.org/tutorial/eclipsecon2011/States&quot; Module:  'module'  name=STRING (machines+=Statemachine)*; Statemachine:  (initial?= 'initial' )?  'statemachine'  name=ID ( 'value'  value=INT)?  '{' 'events'  (events+=Event)*  ';' (states+=State)*  '}' ; Event:  name=ID; State:  SimpleState | CompoundState; SimpleState:  (initial?= 'initial' )?  'state'  name=ID ( 'value'  value=INT)? '{'  (transitions+=Transition)*  '}' ; CompoundState:  'compound'  (initial?= 'initial' )?  'state'  name=ID 'machine'  machine=[ Statemachine ] '{'  (transitions+=Transition)*  '}' ; Transition:  event=[ Event ]  '=>'  state=[ State ];
Validation Diagnose inappropriate source text ,[object Object]
inappropriate names:  ,[object Object],[object Object],[object Object]
Embedded OCLinEcore Validation
External Complete OCL Validation ,[object Object],org.eclipse.ocl.examples.xtext.completeocl ,[object Object]
StatesJavaValidator.java ,[object Object],import  org.eclipse.emf.common.util.URI; import  org.eclipse.ocl.examples.xtext.completeocl.validation.CompleteOCLEObjectValidator; import  org.eclipse.ocl.tutorial.eclipsecon2011.states.StatesPackage; import  org.eclipse.xtext.validation.EValidatorRegistrar; public   class  StatesJavaValidator  extends  AbstractStatesJavaValidator { @Override public   void  register(EValidatorRegistrar registrar) { super .register(registrar); StatesPackage ePackage = StatesPackage. eINSTANCE ; URI oclURI = URI. createPlatformResourceURI ( &quot;/org.eclipse.ocl.tutorial.eclipsecon2011.states.ocl/model/States.ocl&quot; ,  true ); registrar.register(ePackage, new  CompleteOCLEObjectValidator(ePackage, oclURI)); } }
Complete OCL Validation 1 /org.eclipse.ocl.tutorial.eclipsecon2011.states.ocl/model/States.ocl import   'http://ocl.eclipse.org/tutorial/eclipsecon2011/States' package   states context   Statemachine inv  HasInitialState( 'No initial state' ): states -> exists ( s  :  State  |  s . initial ) endpackage Evaluates:  states -> exists ( s  :  State  |  s . initial ) true => silent, invariant is satisfied false => invariant is not satisfied evaluates  'No initial state'  to determine warning diagnostic null => invariant is not satisfied evaluates  'No initial state'  to determine error diagnostic invalid => exception, evaluation failure

Contenu connexe

Tendances

Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Amazon Cognito使って認証したい?それならSpring Security使いましょう!Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Ryosuke Uchitate
 
Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션
Dabi Ahn
 

Tendances (20)

[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
 
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
 
Set Default Values to Fields in Odoo 15
Set Default Values to Fields in Odoo 15Set Default Values to Fields in Odoo 15
Set Default Values to Fields in Odoo 15
 
GitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewGitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code Review
 
Best Practices in Qt Quick/QML - Part 4
Best Practices in Qt Quick/QML - Part 4Best Practices in Qt Quick/QML - Part 4
Best Practices in Qt Quick/QML - Part 4
 
Git basics
Git basicsGit basics
Git basics
 
Let's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APILet's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java API
 
Poster: Cross-Document Linking in DITA
Poster: Cross-Document Linking in DITAPoster: Cross-Document Linking in DITA
Poster: Cross-Document Linking in DITA
 
Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Amazon Cognito使って認証したい?それならSpring Security使いましょう!Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Amazon Cognito使って認証したい?それならSpring Security使いましょう!
 
[DL Hacks 実装]The Conditional Analogy GAN: Swapping Fashion Articles on People...
[DL Hacks 実装]The Conditional Analogy GAN: Swapping Fashion Articles on People...[DL Hacks 実装]The Conditional Analogy GAN: Swapping Fashion Articles on People...
[DL Hacks 実装]The Conditional Analogy GAN: Swapping Fashion Articles on People...
 
新人Git/Github研修公開用スライド(その2)
新人Git/Github研修公開用スライド(その2)新人Git/Github研修公開用スライド(その2)
新人Git/Github研修公開用スライド(その2)
 
JVM code reading -- C2
JVM code reading -- C2JVM code reading -- C2
JVM code reading -- C2
 
Git ve GitHub
Git ve GitHubGit ve GitHub
Git ve GitHub
 
Simplified Android Development with Simple-Stack
Simplified Android Development with Simple-StackSimplified Android Development with Simple-Stack
Simplified Android Development with Simple-Stack
 
Best Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IBest Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part I
 
Large Table Partitioning with PostgreSQL and Django
 Large Table Partitioning with PostgreSQL and Django Large Table Partitioning with PostgreSQL and Django
Large Table Partitioning with PostgreSQL and Django
 
Refactoring and code smells
Refactoring and code smellsRefactoring and code smells
Refactoring and code smells
 
Pre-Con Ed: Introduction to CA Datacom Key Concepts and Facilities Part I
Pre-Con Ed: Introduction to CA Datacom Key Concepts and Facilities Part IPre-Con Ed: Introduction to CA Datacom Key Concepts and Facilities Part I
Pre-Con Ed: Introduction to CA Datacom Key Concepts and Facilities Part I
 
Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션Git 기본개념과 사용법 그리고 어플리케이션
Git 기본개념과 사용법 그리고 어플리케이션
 
ドメイン駆動設計 の 実践 Part3 DDD
ドメイン駆動設計 の 実践 Part3 DDDドメイン駆動設計 の 実践 Part3 DDD
ドメイン駆動設計 の 実践 Part3 DDD
 

En vedette

Automatic Support for the Analysis of Online Collaborative Learning Chat Conv...
Automatic Support for the Analysis of Online Collaborative Learning Chat Conv...Automatic Support for the Analysis of Online Collaborative Learning Chat Conv...
Automatic Support for the Analysis of Online Collaborative Learning Chat Conv...
Stefan Trausan-Matu
 

En vedette (20)

OCL tutorial
OCL tutorial OCL tutorial
OCL tutorial
 
OCL in EMF
OCL in EMFOCL in EMF
OCL in EMF
 
Ocl exercises 1
Ocl exercises 1Ocl exercises 1
Ocl exercises 1
 
Eclipse OCL Summary
Eclipse OCL SummaryEclipse OCL Summary
Eclipse OCL Summary
 
Cours ocl
Cours oclCours ocl
Cours ocl
 
BEEM magnetic microscopy - Data Storage
BEEM magnetic microscopy - Data StorageBEEM magnetic microscopy - Data Storage
BEEM magnetic microscopy - Data Storage
 
Enriching Your Models with OCL
Enriching Your Models with OCLEnriching Your Models with OCL
Enriching Your Models with OCL
 
OCL'16 slides: Models from Code or Code as a Model?
OCL'16 slides: Models from Code or Code as a Model?OCL'16 slides: Models from Code or Code as a Model?
OCL'16 slides: Models from Code or Code as a Model?
 
Progettazione Collaborativa di Scenari di Apprendimento/Insegnamento
Progettazione Collaborativa  di Scenari di Apprendimento/InsegnamentoProgettazione Collaborativa  di Scenari di Apprendimento/Insegnamento
Progettazione Collaborativa di Scenari di Apprendimento/Insegnamento
 
Education 2.0: Leveraging Collaborative Tools for Teaching
Education 2.0: Leveraging Collaborative Tools for TeachingEducation 2.0: Leveraging Collaborative Tools for Teaching
Education 2.0: Leveraging Collaborative Tools for Teaching
 
Collaborative Design of Teaching Scenarios
Collaborative Design of Teaching ScenariosCollaborative Design of Teaching Scenarios
Collaborative Design of Teaching Scenarios
 
Automatic Support for the Analysis of Online Collaborative Learning Chat Conv...
Automatic Support for the Analysis of Online Collaborative Learning Chat Conv...Automatic Support for the Analysis of Online Collaborative Learning Chat Conv...
Automatic Support for the Analysis of Online Collaborative Learning Chat Conv...
 
Online collaborative learning
Online collaborative learningOnline collaborative learning
Online collaborative learning
 
Online Collaborative Learning in ELT
Online Collaborative Learning in ELTOnline Collaborative Learning in ELT
Online Collaborative Learning in ELT
 
Peer assessment in online collaborative learning
Peer assessment in online collaborative learningPeer assessment in online collaborative learning
Peer assessment in online collaborative learning
 
From Research to Practice: The Instructional Design of Online Collaborative L...
From Research to Practice: The Instructional Design of Online Collaborative L...From Research to Practice: The Instructional Design of Online Collaborative L...
From Research to Practice: The Instructional Design of Online Collaborative L...
 
Introduction to Google Apps For Education
Introduction to Google Apps For Education Introduction to Google Apps For Education
Introduction to Google Apps For Education
 
You need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF ProfilesYou need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF Profiles
 
Collaborative and cooperative learning
Collaborative and cooperative learningCollaborative and cooperative learning
Collaborative and cooperative learning
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
 

Similaire à Enrich Your Models With OCL

Xml Java
Xml JavaXml Java
Xml Java
cbee48
 
New and improved: Coming changes to the unittest module
 	 New and improved: Coming changes to the unittest module 	 New and improved: Coming changes to the unittest module
New and improved: Coming changes to the unittest module
PyCon Italia
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
google
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling Framework
Ajay K
 

Similaire à Enrich Your Models With OCL (20)

Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
 
Ocl
OclOcl
Ocl
 
55j7
55j755j7
55j7
 
Xml Java
Xml JavaXml Java
Xml Java
 
A Survey of Concurrency Constructs
A Survey of Concurrency ConstructsA Survey of Concurrency Constructs
A Survey of Concurrency Constructs
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Spring
SpringSpring
Spring
 
New and improved: Coming changes to the unittest module
 	 New and improved: Coming changes to the unittest module 	 New and improved: Coming changes to the unittest module
New and improved: Coming changes to the unittest module
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz
 
Fast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast QueriesFast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast Queries
 
ECMAScript 2015
ECMAScript 2015ECMAScript 2015
ECMAScript 2015
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling Framework
 
Implementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCImplementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoC
 
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of TonguesChoose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
 
Aligning OCL and UML
Aligning OCL and UMLAligning OCL and UML
Aligning OCL and UML
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And Drupal
 

Plus de Edward Willink

Plus de Edward Willink (20)

An OCL Map Type
An OCL Map TypeAn OCL Map Type
An OCL Map Type
 
OCL Visualization A Reality Check
OCL Visualization A Reality CheckOCL Visualization A Reality Check
OCL Visualization A Reality Check
 
OCL 2019 Keynote Retrospective and Prospective
OCL 2019 Keynote Retrospective and ProspectiveOCL 2019 Keynote Retrospective and Prospective
OCL 2019 Keynote Retrospective and Prospective
 
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
 
OCL Specification Status
OCL Specification StatusOCL Specification Status
OCL Specification Status
 
The OCLforUML Profile
The OCLforUML ProfileThe OCLforUML Profile
The OCLforUML Profile
 
At Last an OCL Debugger
At Last an OCL DebuggerAt Last an OCL Debugger
At Last an OCL Debugger
 
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?
 
Safe navigation in OCL
Safe navigation in OCLSafe navigation in OCL
Safe navigation in OCL
 
OCL 2.4. (... 2.5)
OCL 2.4. (... 2.5)OCL 2.4. (... 2.5)
OCL 2.4. (... 2.5)
 
Embedded OCL Integration and Debugging
Embedded OCL Integration and DebuggingEmbedded OCL Integration and Debugging
Embedded OCL Integration and Debugging
 
OCL 2.5 plans
OCL 2.5 plansOCL 2.5 plans
OCL 2.5 plans
 
OCL Integration and Code Generation
OCL Integration and Code GenerationOCL Integration and Code Generation
OCL Integration and Code Generation
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Enrich Your Models With OCL

  • 1. Enrich Your Models with OCL Edward Willink, Thales MDT/OCL Project Lead Axel Uhl, SAP 21st March 2011
  • 2. Part 1: OCL in isolation Installation Instructions OCL Basic Principles exercises OCL Collections and Iterators exercises OCL tools and usage exercises OCL in Java - analyzable language
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 12.
  • 14.
  • 15.
  • 16.
  • 17.
  • 20.
  • 21.
  • 22.
  • 23.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. M2M: OMG QVT, Eclipse QVTo, ATL, Epsilon
  • 34. M2T: OMG MOFM2T, Eclipse Acceleo
  • 35.
  • 36.
  • 37. Multiplicity Example Family Tree Meta-Model Ecore Diagram (similar to UML Class Diagram)
  • 38.
  • 39.
  • 40. 1 MALE, 1 FEMALE parent
  • 41. Self is not an ancestor of self
  • 42. Example Family Tree Model Simple GMF Diagram Editor Runtime Workspace: ESEExampleTree/model/default.people_diagram
  • 43. Simple Query Evaluation Window->Show View->Other... Console Console: New: Interactive Xtext OCL Select Zeus as the Model Context (in any model editor) Type children then carriage return
  • 44.
  • 45. side effect free, no model changes, atomic execution
  • 46. strongly typed, using UML generalization
  • 47. Primitive Types and Literals Java (implementation) OCL (specification) boolean,Boolean,true,false Boolean,true,false short,int,long,Integer,BigInteger Integer , UnlimitedNatural float, double, BigDecimal Real Character, String, 'c', &quot; line &quot; String, 'c', ' line ' Object,this,null OclAny, self ,null Exception invalid Integer value value : Integer Java: practical implementation language OCL: simpler, idealistic, specification language
  • 48. Mathematical Operators Java (implementation) OCL (specification) +, -, *, / +, -, *, / !, &&, ||, ^ not, and, or, xor, implies <, >, <=, >= <, >, <=, >= ==, != = , <> Math.max(4,5) 4.max(5) if (a) b else c; if a then b else c endif Integer value = 5; doSomething(value); let value : Integer = 5 in doSomething(value)
  • 49. More Complex Query Selecting Hera defines the implicit context variable self : Person = Hera
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. Setting Delegate for EStructuralFeature initial value
  • 57. The OCLinEcore Editor OCLinEcore editor maintains EAnnotations automatically OCLinEcore editor provides OCL syntax checking OCLinEcore editor will provide OCL semantic checking
  • 58.
  • 59.
  • 61. Example Validation Failure Open ESEExampleTree/model/People1.xmi in Main Eclipse, with Sample Reflective Ecore Editor Select Universe, Right button menu, Validate
  • 62.
  • 63.
  • 65.
  • 66.
  • 67. getChildren().get(2) getChildren().add(newChild) OCL needs more than just UML multiplicities
  • 68.
  • 69.
  • 70.
  • 71.
  • 72. OCL Navigation Operators anObject. ... object navigation aCollection-> ... collection navigation Shorthands aCollection. ... implicit collect anObject-> ... implicit as set Object Collection . Navigation ? -> ? Navigation
  • 73. Implicit Collect Query parents.parents = parents->collect(parents) 3 symbols, compared to 4 lines of Java 4 grandparents, but not all different!
  • 74. Cleaned up query parents.parents->asSet()->sortedBy(name) ->asSet() converts to Set(Person), removes duplicates ->sortedBy(name) alphabeticizes
  • 75.
  • 76.
  • 77.
  • 78. OCL as Implementation any(x) iteration selects an arbitrary element for which x is true.
  • 79. Derived Properties For Hera invariant MixedGenderParents: father . gender <> mother . gender ; fails because father is null and mother is null
  • 81.
  • 87.
  • 89. Facade to hide internals
  • 90.
  • 91.
  • 92. System comprising a set of model elements
  • 93. A model element changes ....
  • 94. Which of the OCL expressions may have changed its value on which context elements?
  • 95.
  • 96. takes O(|expressions| * |modelElements|)
  • 97.
  • 98.
  • 99. only expression for which model element is changed Go to Efficient, Scalable Notification Handling for EMF (2 hours ago).
  • 100. Benchmark Context Reduction (Average Case) Naive Event-Filtered (*6 Speed-Up) Event-Filtered and Context-Reduced (*1300 Speed-Up vs. Naive, *220 vs. Event-Filtered-Only) Total Re-Evaluation Time in Seconds Number of Model Elements
  • 101. Benchmark Context Reduction (Worst Case) Naive Event-Filtered (*2.4 Speed-Up) Event-Filtered and Context-Reduced (*27 Speed-Up vs. Naive, *11 vs. Event-Filtered-Only) Total Re-Evaluation Time in Seconds Number of Model Elements (apply changes to very central elements, referenced by all other model packages)
  • 102.
  • 103.
  • 104. Use QVTo and OCL to flatten state machine
  • 105.
  • 107.
  • 109.
  • 111.
  • 112. Simple State Machine DSL module &quot;simple.states&quot; statemachine Machine { events START STOP; state Start { STOP => Stop } initial state Stop { START => Start } }
  • 113. The Xtext States Grammar http://www.eclipse.org/modeling/mdt/ocl/docs/publications/EclipseCon2011Tutorial /org.eclipse.ocl.tutorial.eclipsecon2011.states/src/org/eclipse/ocl/tutorial/eclipsecon2011/States.xtext grammar org.eclipse.ocl.tutorial.eclipsecon2011.States with org.eclipse.xtext.common.Terminals generate states &quot;http://ocl.eclipse.org/tutorial/eclipsecon2011/States&quot; Module: 'module' name=STRING (machines+=Statemachine)*; Statemachine: (initial?= 'initial' )? 'statemachine' name=ID ( 'value' value=INT)? '{' 'events' (events+=Event)* ';' (states+=State)* '}' ; Event: name=ID; State: SimpleState | CompoundState; SimpleState: (initial?= 'initial' )? 'state' name=ID ( 'value' value=INT)? '{' (transitions+=Transition)* '}' ; CompoundState: 'compound' (initial?= 'initial' )? 'state' name=ID 'machine' machine=[ Statemachine ] '{' (transitions+=Transition)* '}' ; Transition: event=[ Event ] '=>' state=[ State ];
  • 114.
  • 115.
  • 117.
  • 118.
  • 119. Complete OCL Validation 1 /org.eclipse.ocl.tutorial.eclipsecon2011.states.ocl/model/States.ocl import 'http://ocl.eclipse.org/tutorial/eclipsecon2011/States' package states context Statemachine inv HasInitialState( 'No initial state' ): states -> exists ( s : State | s . initial ) endpackage Evaluates: states -> exists ( s : State | s . initial ) true => silent, invariant is satisfied false => invariant is not satisfied evaluates 'No initial state' to determine warning diagnostic null => invariant is not satisfied evaluates 'No initial state' to determine error diagnostic invalid => exception, evaluation failure
  • 121. Complete OCL Validation 2 context Statemachine def : asError(verdict : Boolean ) : Boolean = if verdict then true else null endif inv HasInitialState( 'No initial state' ): asError ( states -> exists ( s : State | s . initial )) context SimpleState inv NameLength( 'apos;' + name + 'apos; has ' + name . size (). toString () + ' characters when at least 4 wanted' ): name . size () >= 4 inv NameIsLeadingUpperCase( 'apos;' + name + 'apos; must be Leading Uppercase' ): let firstLetter : String = name . substring ( 1 , 1 ) in firstLetter . toUpperCase () = firstLetter
  • 122. Complete OCL Validation 3 context SimpleState def : statemachine : Statemachine = oclContainer ()-> oclAsType ( Statemachine ) inv UniqueInitialState( 'There is more than one initial state' ): initial implies statemachine . states -> select ( initial )-> size () = 1 inv EveryEventIsHandled( let allEvents : Set ( Event ) = statemachine . events -> asSet (), myEvents : Set ( Event ) = self . transitions . event -> asSet () in ( allEvents - myEvents )-> iterate ( e : Event ; s : String = 'The following events are not handled:' | s + ' ' + e . name )): let allEvents : Set ( Event ) = statemachine . events -> asSet (), myEvents : Set ( Event ) = self . transitions . event -> asSet () in ( allEvents - myEvents )-> isEmpty ()
  • 124.
  • 125.
  • 126.
  • 127.
  • 129. Model URI: platform:/resource/org.eclipse.ocl.tutorial.eclipsecon2011.states/ src-gen/org/eclipse/ocl/tutorial/eclipsecon2011/States.ecore
  • 130.
  • 131.
  • 132. check that NameIsUppercase is working
  • 133.
  • 134.
  • 135. tip 2: the closure of all transitions from all initial states includes the state in question
  • 136.
  • 137.
  • 138.
  • 139.
  • 140.
  • 142.
  • 143.
  • 145.
  • 147.
  • 148.
  • 149.
  • 150.
  • 152. change all ... States.ecore refs to OCLStates.ecore
  • 153. set genmodel Operation Reflection to true
  • 154.
  • 155.
  • 156.
  • 157. ( states ) is over protective pretty-printing
  • 158. [?] is UML oriented [1] not [?] is the default
  • 159. { ordered } is UML oriented { ! ordered unique } is the default
  • 160. Embedded Constraints 2 invariant UniqueInitialState( 'There is more than one initial state' ): initial implies ((( statemachine ). states )-> select ( initial ))-> size () = 1 ; invariant NameIsLeadingUpperCase( 'apos;' + name + 'apos; must be Leading Uppercase' ): let firstLetter : String = ( name ). substring ( 1 , 1 ) in firstLetter . toUpperCase () = firstLetter ; invariant NameLength( 'apos;' + name + 'apos; has ' + (( name ). size ()). toString () + ' characters when at least 4 wanted' ): ( name ). size () >= 4 ; invariant EveryEventIsHandled( let allEvents : Set ( Event ) = (( statemachine ). events )-> asSet () in let myEvents : Set ( Event ) = (( self . transitions )-> collect ( event ))-> asSet () in ( allEvents - myEvents )-> iterate ( e : Event ; s : String = 'The following events are not handled:' | s + ' ' + e . name )): let allEvents : Set ( Event ) = (( statemachine ). events )-> asSet () in let myEvents : Set ( Event ) = (( self . transitions )-> collect ( event ))-> asSet () in ( allEvents - myEvents )-> isEmpty (); property statemachine : Statemachine [?] { derived } { derivation : ( oclContainer ()). oclAsType ( Statemachine ); }
  • 161.
  • 162. Use an extended Validator API for
  • 163.
  • 164.
  • 165.
  • 166.
  • 167. Add a new constraint to OCLStates.ecore
  • 168. Regenerate Java with OCLStates.genmodel
  • 169.
  • 170.
  • 173. Run Generate Simple States
  • 174. Inspect *.java generate.mtl
  • 175.
  • 176.
  • 177. one class for the State Machine
  • 178. one class for each State
  • 179. one method for each Event
  • 180. States to Java Classes module &quot;simple.states&quot; statemachine Machine { events START STOP; state Start { START => Start } initial state Stop { STOP => Stop } } package simple.states; public class Stop implements Machine.State { private final Machine sm ; public Stop(Machine sm) { this . sm = sm; } public void doSTOP() { sm .setState(STATES. STATE_Stop ); } } package simple.states; public class Machine { public interface State { public void doSTART(); public void doSTOP(); enum STATES { STATE_Start , STATE_Stop } }
  • 181.
  • 182.
  • 184.
  • 185.
  • 186.
  • 187.
  • 188.
  • 189. OCL: e.name + '.java' e.states
  • 190.
  • 191.
  • 192. package simple.states; public class Machine { public interface State { public void doSTART(); public void doSTOP(); enum STATES { STATE_Start , STATE_Stop } } Acceleo Text Template 2 [template public generateStatemachineClass(m : Module, e : Statemachine)] package [ m.getPackageName() /] ; public class [ e.getStateMachineClassName() /] { public interface State { [for ( v : Event | e.events) ] public void [ v.getEventMethodName() /] (); [/for] enum STATES { [for ( s : State | e.states) separator ( ',' ) after ( '' ) ] [ s.getStateEnumName() /] [/for] } } ... public [ e.getStateMachineClassName() /] () { setState(State.STATES. [ e.getInitialState().getStateEnumName() /] ); } public Machine() { setState(State.STATES. STATE_Stop ); }
  • 193.
  • 194. protects downstream from garbage in ...
  • 195.
  • 196. Change the enums from STATE to ENUM prefix
  • 198.
  • 200.
  • 202. Run Flatten States to XMI or Flatten States
  • 203. Inspect flattened.xmi Inspect flattened.states FlattenStates.qvto
  • 204.
  • 205.
  • 206.
  • 207. Statemachine Flattening Example module &quot;compound.states&quot; statemachine Outer { events START STOP; initial state Start value 4 { START => CompoundA } state Stop value 5 { STOP => CompoundB } compound state CompoundA machine Inner { START => Stop } compound state CompoundB machine Inner { STOP => Stop } } statemachine Inner { events LEFT RIGHT; initial state Left value 1 { LEFT => Right } state Right { RIGHT => Left } } module &quot;flattened.compound.states&quot; statemachine Outer { events STOP RIGHT LEFT START; initial state Start value 4 { START => CompoundA_Left } state Stop value 5 { STOP => CompoundB_Left } state CompoundA_Left value 1 { LEFT => CompoundA_Right START => Stop } state CompoundA_Right { RIGHT => CompoundA_Left START => Stop } state CompoundB_Left value 1 { LEFT => CompoundB_Right STOP => Stop } state CompoundB_Right { RIGHT => CompoundB_Left STOP => Stop } }
  • 208. root mapping mapping HIER :: Module :: model2FLATModel () : FLAT :: Module { name := 'flattened.' + self . name ; var name2state : Dict ( String , HIER :: State ); var allMachines : Set ( HIER :: Statemachine ) = self . machines . allMachines ()-> asSet (); var allStates : Set ( HIER :: State ) = allMachines. states -> asSet (); var allCompoundStates : Set ( HIER :: CompoundState ) = allStates-> select ( oclIsTypeOf ( HIER :: CompoundState )) -> collect ( oclAsType ( HIER :: CompoundState ))-> asSet (); var rootMachines : Set ( HIER :: Statemachine ) = allMachines-> select (m : HIER :: Statemachine | not allCompoundStates-> exists ( machine = m)); machines := rootMachines-> map machine2machine (name2state); }
  • 209.
  • 210.
  • 211.
  • 212.
  • 213. from-compound => all exitTransitions
  • 214. iterate to form concatenated string query HIER :: State :: getStateName (hierarchy : Sequence ( HIER :: CompoundState )) : String { return hierarchy->iterate(c : HIER :: CompoundState ; s : String = self . name | c. name + '_' + s) }
  • 215. conditional hierachical selection query HIER :: State :: initialStateName (hierarchy : Sequence ( HIER :: CompoundState )) : String { var stateName : String = self . getStateName (hierarchy); return if self . oclIsKindOf ( HIER :: CompoundState ) then let compoundState : HIER :: CompoundState = self . oclAsType ( HIER :: CompoundState ) in compoundState. machine . states -> any ( initial ) . initialStateName (hierarchy-> append (compoundState)) else stateName endif }
  • 216. simple navigation/logic mapping HIER :: SimpleState :: simpleState2state ( name2state : Dict ( String , HIER :: State ), hierarchy : Sequence ( HIER :: CompoundState ) ) : FLAT :: SimpleState { var stateName : String = self . getStateName (hierarchy); name := stateName; value := self . value ; initial := hierarchy-> isEmpty () and self . initial ; name2state-> put (stateName, result ); }
  • 217. iterate to create objects mapping HIER :: SimpleState :: simpleState2transitions2 ( name2state : Dict ( String , HIER :: State ), hierarchy : Sequence ( HIER :: CompoundState ), exitTransitions : Dict ( FLAT :: Event , FLAT :: State ) ) : FLAT :: State { init { var stateName : String = self . getStateName (hierarchy); result := name2state-> get (stateName); } transitions := exitTransitions-> keys ()->iterate(v : FLAT :: Event ; acc : Sequence ( HIER :: Transition ) = self . transitions . map transition2transition (name2state, hierarchy) | acc-> append ( object FLAT :: Transition { state := exitTransitions-> get (v); event := v; }) ); }
  • 218.
  • 219.
  • 220.
  • 222.
  • 225.
  • 226.
  • 227.
  • 228. 'var' used to cache partial/temporary states
  • 229.
  • 230.
  • 231.
  • 232.
  • 233.
  • 234.
  • 235.
  • 236. Ecore behavioral extension - OCLinEcore editor
  • 237. dynamic and genmodeled validation
  • 238.
  • 239. Eclipse OCL evolving an extensible GUI
  • 240.