SlideShare a Scribd company logo
Made available under EPL 2.0
Shadow Objects
Edward D. 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, 1.4 RTF Chair
OCL 2018 @ MODELS 2018
14th October 2018
14 October 2018 Shadow Objects 2Made available under EPL 2.0
Why can't I create an object in OCL?
Object creation has a side effect in the memory
OCL evaluation is side effect free
14 October 2018 Shadow Objects 3Made available under EPL 2.0
Solution
OCL §8.3.8 'solution'
declare as post conditions of a 'make' function
context Parameter::make(n : String, c : Classifier,
k : ParameterDirectionKind) :Parameter
post: result.name = n
post: result.kind = k
post: result.type = c
idiomatic, ugly
Type construction
Tuple literal syntax re-use
Parameter{name = n, kind = k, type = c}
Regular OCL expression
14 October 2018 Shadow Objects 4Made available under EPL 2.0
Memory side effect
Evaluate
uml::State { name : String = 'me' } =
uml::State { name : String = 'me' }
true / false
NB LHS, RHS may be arbitrary query returns
cf Java
1 = 1; // true
new Integer(1) = new Integer(1); // false
"new" allocates memory
two identical objects at different addresses
OCL must be side effect free
identical (re-)constructions must be equal
not regular objects
14 October 2018 Shadow Objects 5Made available under EPL 2.0
Shadow Objects
cf Integers
all Integers exist
programs use only some Integers
Shadow Objects
all possible Shadow Objects exist
pre-existing Shadow Object returned by constructor
shared, therefore equal
re-used, therefore no side effect
immutable
practical implementation lazily creates on first use
IMMUTABLE LAZY 'PRE-EXISTING'
14 October 2018 Shadow Objects 6Made available under EPL 2.0
Shadow Relationships
container always null
cannot be (multiply-) contained
by a user model
root shadow object may contain
regular objects
can only reference shadow
objects/children
cannot be referenced from
user models
no piecemeal bidirectionals
atomic construction only
can share datatype values
shadow 'model'
forest of isolated object trees
User Model
Root
A B
C
Shadow 'Model'
X Y
Y
null null
'me'
14 October 2018 Shadow Objects 7Made available under EPL 2.0
Shadow Objects in use
shadow object OCL expression unuseable
cannot be contained or bidirectionally referenced
let aNode = Node{containedNode = Node{}} in -- ok
Node{containedNode = aNode} -- bad/clone
OCL use as a child / QVT assignment to container
must clone 'contained' shadow object as regular object
QVT assignment to reference
illegal
must use a clone already assigned to a container
(practical implementation may use shadow as the
clone if shadow no longer referenced.)
14 October 2018 Shadow Objects 8Made available under EPL 2.0
Summary
regular object construction
not side-effect-free
shadow object construction
allows OCL to return an object / object pattern
RHS of a model to model transformation
shadow object cloning
accommodates side-effects
executable semantics for OCL §8.3.8
context Parameter::make(n : String, c : Classifier,
k : ParameterDirectionKind) :Parameter
post: result.name = n
post: result.kind = k
post: result.type = c

More Related Content

Similar to Shadow Objects

ch12 (1).ppt
ch12 (1).pptch12 (1).ppt
ch12 (1).ppt
ssuserf78966
 
PDE2011 pythonOCC project status and plans
PDE2011 pythonOCC project status and plansPDE2011 pythonOCC project status and plans
PDE2011 pythonOCC project status and plans
Thomas Paviot
 
The OCLforUML Profile
The OCLforUML ProfileThe OCLforUML Profile
The OCLforUML Profile
Edward Willink
 
New c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_iNew c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_i
Nico Ludwig
 
OCL Visualization A Reality Check
OCL Visualization A Reality CheckOCL Visualization A Reality Check
OCL Visualization A Reality Check
Edward Willink
 
Android architecture
Android architecture Android architecture
Android architecture
Trong-An Bui
 
Effective Scala: Programming Patterns
Effective Scala: Programming PatternsEffective Scala: Programming Patterns
Effective Scala: Programming PatternsVasil Remeniuk
 
Objects
ObjectsObjects
Objects
Chang John
 
Angular 2 Crash Course
Angular  2 Crash CourseAngular  2 Crash Course
Angular 2 Crash Course
Elisha Kramer
 
Virtual EMF - Standard talk at EclipseCon Europe 2011
Virtual EMF - Standard talk at EclipseCon Europe 2011Virtual EMF - Standard talk at EclipseCon Europe 2011
Virtual EMF - Standard talk at EclipseCon Europe 2011Hugo Bruneliere
 
Migrating an Application from Angular 1 to Angular 2
Migrating an Application from Angular 1 to Angular 2 Migrating an Application from Angular 1 to Angular 2
Migrating an Application from Angular 1 to Angular 2
Ross Dederer
 
An Element-wise Visual-enhanced BiLSTM-CRF Model for Location Name Recognition
An Element-wise Visual-enhanced BiLSTM-CRF Model for Location Name RecognitionAn Element-wise Visual-enhanced BiLSTM-CRF Model for Location Name Recognition
An Element-wise Visual-enhanced BiLSTM-CRF Model for Location Name Recognition
Takashi Inui
 
Safe navigation in OCL
Safe navigation in OCLSafe navigation in OCL
Safe navigation in OCL
Edward Willink
 
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
Daniel Lehner
 
Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2
Ross Dederer
 
Static Keyword Static is a keyword in C++ used to give special chara.pdf
  Static Keyword Static is a keyword in C++ used to give special chara.pdf  Static Keyword Static is a keyword in C++ used to give special chara.pdf
Static Keyword Static is a keyword in C++ used to give special chara.pdf
KUNALHARCHANDANI1
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.ppt
TigistTilahun1
 
MOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptxMOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptx
kamalkantmaurya1
 
moocs_ppt.pptx
moocs_ppt.pptxmoocs_ppt.pptx
moocs_ppt.pptx
kamalkantmaurya1
 
AR / VR Interaction Development with Unity
AR / VR Interaction Development with UnityAR / VR Interaction Development with Unity
AR / VR Interaction Development with Unity
Andreas Jakl
 

Similar to Shadow Objects (20)

ch12 (1).ppt
ch12 (1).pptch12 (1).ppt
ch12 (1).ppt
 
PDE2011 pythonOCC project status and plans
PDE2011 pythonOCC project status and plansPDE2011 pythonOCC project status and plans
PDE2011 pythonOCC project status and plans
 
The OCLforUML Profile
The OCLforUML ProfileThe OCLforUML Profile
The OCLforUML Profile
 
New c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_iNew c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_i
 
OCL Visualization A Reality Check
OCL Visualization A Reality CheckOCL Visualization A Reality Check
OCL Visualization A Reality Check
 
Android architecture
Android architecture Android architecture
Android architecture
 
Effective Scala: Programming Patterns
Effective Scala: Programming PatternsEffective Scala: Programming Patterns
Effective Scala: Programming Patterns
 
Objects
ObjectsObjects
Objects
 
Angular 2 Crash Course
Angular  2 Crash CourseAngular  2 Crash Course
Angular 2 Crash Course
 
Virtual EMF - Standard talk at EclipseCon Europe 2011
Virtual EMF - Standard talk at EclipseCon Europe 2011Virtual EMF - Standard talk at EclipseCon Europe 2011
Virtual EMF - Standard talk at EclipseCon Europe 2011
 
Migrating an Application from Angular 1 to Angular 2
Migrating an Application from Angular 1 to Angular 2 Migrating an Application from Angular 1 to Angular 2
Migrating an Application from Angular 1 to Angular 2
 
An Element-wise Visual-enhanced BiLSTM-CRF Model for Location Name Recognition
An Element-wise Visual-enhanced BiLSTM-CRF Model for Location Name RecognitionAn Element-wise Visual-enhanced BiLSTM-CRF Model for Location Name Recognition
An Element-wise Visual-enhanced BiLSTM-CRF Model for Location Name Recognition
 
Safe navigation in OCL
Safe navigation in OCLSafe navigation in OCL
Safe navigation in OCL
 
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
Modeling Capabilities of Digital Twin Platforms: Old Wine in New Bottles?
 
Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2
 
Static Keyword Static is a keyword in C++ used to give special chara.pdf
  Static Keyword Static is a keyword in C++ used to give special chara.pdf  Static Keyword Static is a keyword in C++ used to give special chara.pdf
Static Keyword Static is a keyword in C++ used to give special chara.pdf
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.ppt
 
MOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptxMOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptx
 
moocs_ppt.pptx
moocs_ppt.pptxmoocs_ppt.pptx
moocs_ppt.pptx
 
AR / VR Interaction Development with Unity
AR / VR Interaction Development with UnityAR / VR Interaction Development with Unity
AR / VR Interaction Development with Unity
 

More from Edward Willink

An OCL Map Type
An OCL Map TypeAn OCL Map Type
An OCL Map Type
Edward Willink
 
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
Edward Willink
 
Commutative Short Circuit Operators
Commutative Short Circuit OperatorsCommutative Short Circuit Operators
Commutative Short Circuit Operators
Edward Willink
 
Deterministic Lazy Mutable OCL Collections
Deterministic Lazy Mutable OCL CollectionsDeterministic Lazy Mutable OCL Collections
Deterministic Lazy Mutable OCL Collections
Edward Willink
 
The Micromapping Model of Computation
The Micromapping Model of ComputationThe Micromapping Model of Computation
The Micromapping Model of Computation
Edward Willink
 
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
Edward Willink
 
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...
Edward Willink
 
The Importance of Opposites
The Importance of OppositesThe Importance of Opposites
The Importance of Opposites
Edward Willink
 
OCL Specification Status
OCL Specification StatusOCL Specification Status
OCL Specification Status
Edward Willink
 
At Last an OCL Debugger
At Last an OCL DebuggerAt Last an OCL Debugger
At Last an OCL Debugger
Edward Willink
 
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?
Edward Willink
 
OCL 2.4. (... 2.5)
OCL 2.4. (... 2.5)OCL 2.4. (... 2.5)
OCL 2.4. (... 2.5)
Edward Willink
 
Embedded OCL Integration and Debugging
Embedded OCL Integration and DebuggingEmbedded OCL Integration and Debugging
Embedded OCL Integration and Debugging
Edward Willink
 
OCL 2.5 plans
OCL 2.5 plansOCL 2.5 plans
OCL 2.5 plans
Edward Willink
 
OCL Integration and Code Generation
OCL Integration and Code GenerationOCL Integration and Code Generation
OCL Integration and Code Generation
Edward Willink
 
Yet Another Three QVT Languages
Yet Another Three QVT LanguagesYet Another Three QVT Languages
Yet Another Three QVT Languages
Edward Willink
 
OCL - The Bigger Picture
OCL - The Bigger PictureOCL - The Bigger Picture
OCL - The Bigger Picture
Edward Willink
 
UMLX and QVT and ATL
UMLX and QVT and ATLUMLX and QVT and ATL
UMLX and QVT and ATL
Edward Willink
 
Model Transformation A Personal Perspective
Model Transformation A Personal PerspectiveModel Transformation A Personal Perspective
Model Transformation A Personal Perspective
Edward Willink
 
Fast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast QueriesFast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast Queries
Edward Willink
 

More from Edward Willink (20)

An OCL Map Type
An OCL Map TypeAn OCL Map Type
An OCL Map Type
 
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
 
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
 
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?
 
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
 
Yet Another Three QVT Languages
Yet Another Three QVT LanguagesYet Another Three QVT Languages
Yet Another Three QVT Languages
 
OCL - The Bigger Picture
OCL - The Bigger PictureOCL - The Bigger Picture
OCL - The Bigger Picture
 
UMLX and QVT and ATL
UMLX and QVT and ATLUMLX and QVT and ATL
UMLX and QVT and ATL
 
Model Transformation A Personal Perspective
Model Transformation A Personal PerspectiveModel Transformation A Personal Perspective
Model Transformation A Personal Perspective
 
Fast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast QueriesFast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast Queries
 

Recently uploaded

How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 

Recently uploaded (20)

How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 

Shadow Objects

  • 1. Made available under EPL 2.0 Shadow Objects Edward D. 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, 1.4 RTF Chair OCL 2018 @ MODELS 2018 14th October 2018
  • 2. 14 October 2018 Shadow Objects 2Made available under EPL 2.0 Why can't I create an object in OCL? Object creation has a side effect in the memory OCL evaluation is side effect free
  • 3. 14 October 2018 Shadow Objects 3Made available under EPL 2.0 Solution OCL §8.3.8 'solution' declare as post conditions of a 'make' function context Parameter::make(n : String, c : Classifier, k : ParameterDirectionKind) :Parameter post: result.name = n post: result.kind = k post: result.type = c idiomatic, ugly Type construction Tuple literal syntax re-use Parameter{name = n, kind = k, type = c} Regular OCL expression
  • 4. 14 October 2018 Shadow Objects 4Made available under EPL 2.0 Memory side effect Evaluate uml::State { name : String = 'me' } = uml::State { name : String = 'me' } true / false NB LHS, RHS may be arbitrary query returns cf Java 1 = 1; // true new Integer(1) = new Integer(1); // false "new" allocates memory two identical objects at different addresses OCL must be side effect free identical (re-)constructions must be equal not regular objects
  • 5. 14 October 2018 Shadow Objects 5Made available under EPL 2.0 Shadow Objects cf Integers all Integers exist programs use only some Integers Shadow Objects all possible Shadow Objects exist pre-existing Shadow Object returned by constructor shared, therefore equal re-used, therefore no side effect immutable practical implementation lazily creates on first use IMMUTABLE LAZY 'PRE-EXISTING'
  • 6. 14 October 2018 Shadow Objects 6Made available under EPL 2.0 Shadow Relationships container always null cannot be (multiply-) contained by a user model root shadow object may contain regular objects can only reference shadow objects/children cannot be referenced from user models no piecemeal bidirectionals atomic construction only can share datatype values shadow 'model' forest of isolated object trees User Model Root A B C Shadow 'Model' X Y Y null null 'me'
  • 7. 14 October 2018 Shadow Objects 7Made available under EPL 2.0 Shadow Objects in use shadow object OCL expression unuseable cannot be contained or bidirectionally referenced let aNode = Node{containedNode = Node{}} in -- ok Node{containedNode = aNode} -- bad/clone OCL use as a child / QVT assignment to container must clone 'contained' shadow object as regular object QVT assignment to reference illegal must use a clone already assigned to a container (practical implementation may use shadow as the clone if shadow no longer referenced.)
  • 8. 14 October 2018 Shadow Objects 8Made available under EPL 2.0 Summary regular object construction not side-effect-free shadow object construction allows OCL to return an object / object pattern RHS of a model to model transformation shadow object cloning accommodates side-effects executable semantics for OCL §8.3.8 context Parameter::make(n : String, c : Classifier, k : ParameterDirectionKind) :Parameter post: result.name = n post: result.kind = k post: result.type = c