ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Visitors Framework
Generator
Computer Science Department
University of York
Adolfo S¨¢nchez-Barbudo Herrera (asbh500@york.ac.uk)
Agenda
¡ñ Visitor Pattern
¡ñ Visitors Framework Generator
¡ð Overview
¡ð Model traversals
¡ð Visitors framework
¡ð Example
¡ñ Visitors in Eclipse OCL/QVTd
¡ñ Conclusions
2
Visitor Pattern
¡ñ OOP design pattern
¡ñ Separate structure from behaviour
2
Visitor Pattern II
¡ñ Add/Remove/Modify/Replace behaviour
without changing structure.
¡ð Ideal when working with third party structures.
3
Visitor Pattern III
¡ñ Main disadvantage
¡ð It¡¯s not the ideal pattern with evolving structures.
4
Visitor Pattern IV
¡ñ Visitors applied to modeling languages
5
Visitors Framework Generator
¡ñ VFG Overview
VFG
Ecore
Model
Visitable
Model
Implementation
Visitor/
Visitable
Interfaces
Abstract
Visitors
Impl.
Model-Specific Visitors
Framework
Manual
Visitors
Generated
Visitors
More
MDE-based
generators
Manual Generated
6
Visitor Generation Framework II
¡ñ Visitable implementation from Ecore MM
7
Visitor Generation Framework III
¡ñ Ecore MM specific visitors framework
1. Visitor/Visitable
Interfaces
2. Default Abstract
Implementations
¡ñ Contextful Visitor
¡ñ Null Visitor
¡ñ Extending Visitor
¡ñ Delegating Visitor
¡ñ ...
8
Model traversals
9
Model Traverals II
¡ñ Traversal in accept method
¡ð Doomed to the same traversal algorithm.
10
¡ñ Traversal in client code
¡ð Ok, but traversal is part of the algorithm
¡ñ Traversal in visitors
¡ð Best, but more patterns for reuse sake
Traversal
Visitor
Action
Visitors Framework
11
Visitors Framework II
12
Visitors Framework III
13
Example
14
Visitors Usage in Eclipse OCL/QVTd
¡ñ Eclipse OCL
¡ð 7 Ecore metamodels
¡ð 48 generated abstract visitors
¡ð 67 manual visitors
¡ñ Eclipse QVTd
¡ð 10 Ecore metamodels
¡ð 89 generated abstract visitors
¡ð 76 manual visitors
15
Conclusions
¡ñ VFG:
¡ð Automatically brings the benefits of the visitor
pattern to Ecore-based models
¡ð Automatically creates a MM-specific framework to
leverage visitors creation
¡ð It?s a convenient practice when your models have
unclear behaviour or an evolving one
¡ð It?s a key practice to let clients add their specific
behaviour algorithms
¡ð A key tool in the development of Eclipse OCL/QVTd
16
Thank you very much
Questions ?
doubts, feedback, enquiries, etc. to asbh500@york.ac.uk

More Related Content

Similar to Visitors Framework Generator (17)

PDF
The Visitor Classic Design Pattern [Free Meetup]
Haim Michael
?
PDF
Tutorial visitor
Wei Wang
?
PPTX
JavaZone 2014 - Iteration 2.0: Stream
Martin (¸ßñR¶¡) Skarsaune
?
PDF
Designing functional and fluent API: application to some GoF patterns
Jos¨¦ Paumard
?
PPTX
Visitor design pattern
Salem-Kabbani
?
PPS
Ajs 3 a
Niit Care
?
PPT
Software Design Patterns
Satheesh Sukumaran
?
PPT
Software Design Patterns
Satheesh Sukumaran
?
PPT
10-DesignPatterns.ppt
TAGADPALLEWARPARTHVA
?
PPT
Design patterns represent the best practices used by experienced object-orien...
nevanak569
?
PDF
Gof design pattern
naveen kumar
?
PPTX
Visitor design patterns
Nishant Mevawala
?
PDF
Visitor pattern
Michael Fong
?
PDF
Design Patterns & JDK Examples
Ender Aydin Orak
?
PPT
Introduction to design_patterns
amitarcade
?
PDF
Eclipse Modeling Framework (EMF) and Graphical Modeling Framework (GMF)
Dimitris Kolovos
?
PPTX
J2EE pattern 5
Naga Muruga
?
The Visitor Classic Design Pattern [Free Meetup]
Haim Michael
?
Tutorial visitor
Wei Wang
?
JavaZone 2014 - Iteration 2.0: Stream
Martin (¸ßñR¶¡) Skarsaune
?
Designing functional and fluent API: application to some GoF patterns
Jos¨¦ Paumard
?
Visitor design pattern
Salem-Kabbani
?
Ajs 3 a
Niit Care
?
Software Design Patterns
Satheesh Sukumaran
?
Software Design Patterns
Satheesh Sukumaran
?
10-DesignPatterns.ppt
TAGADPALLEWARPARTHVA
?
Design patterns represent the best practices used by experienced object-orien...
nevanak569
?
Gof design pattern
naveen kumar
?
Visitor design patterns
Nishant Mevawala
?
Visitor pattern
Michael Fong
?
Design Patterns & JDK Examples
Ender Aydin Orak
?
Introduction to design_patterns
amitarcade
?
Eclipse Modeling Framework (EMF) and Graphical Modeling Framework (GMF)
Dimitris Kolovos
?
J2EE pattern 5
Naga Muruga
?

Recently uploaded (20)

PDF
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
?
PPTX
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
?
PPTX
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
?
PDF
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
?
PPTX
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
?
PDF
Validating a Citizen Observatories enabling Platform by completing a Citizen ...
Diego L¨®pez-de-Ipi?a Gonz¨¢lez-de-Artaza
?
PPTX
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
?
PDF
How to Buy Verified CashApp Accounts IN 2025
Buy Verified CashApp Accounts
?
PPTX
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
moonsony54
?
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
?
PDF
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
?
PPTX
Work at Height training for workers .pptx
cecos12
?
PPTX
Functions in Python Programming Language
BeulahS2
?
PDF
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
?
PDF
01-introduction to the ProcessDesign.pdf
StiveBrack
?
PDF
lesson4-occupationalsafetyandhealthohsstandards-240812020130-1a7246d0.pdf
arvingallosa3
?
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
?
PDF
????? ?? ??????? ?????????? ????? ?????? ??? ????.pdf
???? ??? ?????
?
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
?
PDF
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
?
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
?
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
?
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
?
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
?
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
?
Validating a Citizen Observatories enabling Platform by completing a Citizen ...
Diego L¨®pez-de-Ipi?a Gonz¨¢lez-de-Artaza
?
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
?
How to Buy Verified CashApp Accounts IN 2025
Buy Verified CashApp Accounts
?
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
moonsony54
?
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
?
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
?
Work at Height training for workers .pptx
cecos12
?
Functions in Python Programming Language
BeulahS2
?
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
?
01-introduction to the ProcessDesign.pdf
StiveBrack
?
lesson4-occupationalsafetyandhealthohsstandards-240812020130-1a7246d0.pdf
arvingallosa3
?
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
?
????? ?? ??????? ?????????? ????? ?????? ??? ????.pdf
???? ??? ?????
?
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
?
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
?
Ad

Visitors Framework Generator

  • 1. Visitors Framework Generator Computer Science Department University of York Adolfo S¨¢nchez-Barbudo Herrera (asbh500@york.ac.uk)
  • 2. Agenda ¡ñ Visitor Pattern ¡ñ Visitors Framework Generator ¡ð Overview ¡ð Model traversals ¡ð Visitors framework ¡ð Example ¡ñ Visitors in Eclipse OCL/QVTd ¡ñ Conclusions 2
  • 3. Visitor Pattern ¡ñ OOP design pattern ¡ñ Separate structure from behaviour 2
  • 4. Visitor Pattern II ¡ñ Add/Remove/Modify/Replace behaviour without changing structure. ¡ð Ideal when working with third party structures. 3
  • 5. Visitor Pattern III ¡ñ Main disadvantage ¡ð It¡¯s not the ideal pattern with evolving structures. 4
  • 6. Visitor Pattern IV ¡ñ Visitors applied to modeling languages 5
  • 7. Visitors Framework Generator ¡ñ VFG Overview VFG Ecore Model Visitable Model Implementation Visitor/ Visitable Interfaces Abstract Visitors Impl. Model-Specific Visitors Framework Manual Visitors Generated Visitors More MDE-based generators Manual Generated 6
  • 8. Visitor Generation Framework II ¡ñ Visitable implementation from Ecore MM 7
  • 9. Visitor Generation Framework III ¡ñ Ecore MM specific visitors framework 1. Visitor/Visitable Interfaces 2. Default Abstract Implementations ¡ñ Contextful Visitor ¡ñ Null Visitor ¡ñ Extending Visitor ¡ñ Delegating Visitor ¡ñ ... 8
  • 11. Model Traverals II ¡ñ Traversal in accept method ¡ð Doomed to the same traversal algorithm. 10 ¡ñ Traversal in client code ¡ð Ok, but traversal is part of the algorithm ¡ñ Traversal in visitors ¡ð Best, but more patterns for reuse sake Traversal Visitor Action
  • 16. Visitors Usage in Eclipse OCL/QVTd ¡ñ Eclipse OCL ¡ð 7 Ecore metamodels ¡ð 48 generated abstract visitors ¡ð 67 manual visitors ¡ñ Eclipse QVTd ¡ð 10 Ecore metamodels ¡ð 89 generated abstract visitors ¡ð 76 manual visitors 15
  • 17. Conclusions ¡ñ VFG: ¡ð Automatically brings the benefits of the visitor pattern to Ecore-based models ¡ð Automatically creates a MM-specific framework to leverage visitors creation ¡ð It?s a convenient practice when your models have unclear behaviour or an evolving one ¡ð It?s a key practice to let clients add their specific behaviour algorithms ¡ð A key tool in the development of Eclipse OCL/QVTd 16
  • 18. Thank you very much Questions ? doubts, feedback, enquiries, etc. to asbh500@york.ac.uk