Automatic Application of
Visitors to Evolving
Domain-Specific
Languages
Computer Science Department
University of York1
& ...
2

Agenda
●
●
●
●
●
●
●

Introduction to Modeling (MDSD, MDE,...)
Model Behaviour
Model Evolution
Visitor Pattern
Visitor ...
3

Modeling Introduction
●
●
●
●

Models as main artefact for developing SW
Models as abstract representations of SW
Highe...
4

Modeling Introduction II
With a modeling language you can create model
instances, which correspond to objects at runtim...
5

Modeling Introduction III
● MDE techniques to support software
development:
Model to Text
Model to Model
Transformation...
6

Model Behaviour
● Model concepts may comprise behaviour
● Usually modelled as Operations

A user can create new posts i...
7

Model Evolution
● Model evolution - like SW evolution - is a
recurrent and open issue.
8

Model Evolution II
● Same issues regarding behaviour.
9

Visitor Pattern
● OOP design pattern
○ Well known solutions to a recurring problem

● Separate structure from behaviour
10

Visitor Pattern II
● Main advantage
○ Add/Remove/Modify/Replace behaviour without
changing structure.
○ Ideal when wor...
11

Visitor Pattern III
● Main disadvantage
○ It’s not the ideal pattern with evolving structures.
12

Visitor Pattern IV
● Visitors applied to modeling languages
13

Visitor Generation Framework
● MDE based prototype to automatically apply
the visitor pattern.
● Part 1.
○ Setup the D...
14

Visitor Generation Framework II
● M2M transformation to prepare the DSL
15

Visitor Generation Framework III
● DSL-specific visitors framework generation
1. Visitor/Visitable
Interfaces
●
●
●
●
...
16

Visitor Generation Framework IV
● VGF abstract visitors examples:
17

Visitor Generation Framework V
● VGF Overview
Visitable
DSL
Implementation

DSL
Model

VGF

DSL-Specific Visitors
Fram...
18

VGF for models behaviour evolution
● Evolving behaviour - Same structure
Behaviour

No Model Visitors

Model Visitors
...
19

Conclusions
● VGF:
○ Automatically brings the benefits of the visitor
pattern to DSLs
○ Automatically creates a DSL-sp...
Thank you very much
Questions ?

doubts, feedback, enquiries, etc. to asbh500@york.ac.uk
Upcoming SlideShare
Loading in...5
×

Automatic Application of Visitors to Evolving Domain-Specific Languages

144

Published on

MDE-based approach to automatically apply the Visitor design pattern to your Ecore-based languages (DSLs)

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
144
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Automatic Application of Visitors to Evolving Domain-Specific Languages

  1. 1. Automatic Application of Visitors to Evolving Domain-Specific Languages Computer Science Department University of York1 & Willink Transformations Ltd2. Adolfo Sánchez-Barbudo Herrera1, Ed Willink2, Richard Paige1, Louis Rose1, Dimitris Kolovos1 (asbh500@york.ac.uk ed@willink.me.uk richard.paige@york.ac.uk, louis.rose@york.ac.uk, dimitris.kolovos@york.ac.uk)
  2. 2. 2 Agenda ● ● ● ● ● ● ● Introduction to Modeling (MDSD, MDE,...) Model Behaviour Model Evolution Visitor Pattern Visitor Generation Framework (VGF) VGF for Model Behaviour Evolution Conclusions
  3. 3. 3 Modeling Introduction ● ● ● ● Models as main artefact for developing SW Models as abstract representations of SW Higher level of abstraction than programs Programs replaced by Models uBlog DSL
  4. 4. 4 Modeling Introduction II With a modeling language you can create model instances, which correspond to objects at runtime.
  5. 5. 5 Modeling Introduction III ● MDE techniques to support software development: Model to Text Model to Model Transformations Transformations
  6. 6. 6 Model Behaviour ● Model concepts may comprise behaviour ● Usually modelled as Operations A user can create new posts in a given uBlog
  7. 7. 7 Model Evolution ● Model evolution - like SW evolution - is a recurrent and open issue.
  8. 8. 8 Model Evolution II ● Same issues regarding behaviour.
  9. 9. 9 Visitor Pattern ● OOP design pattern ○ Well known solutions to a recurring problem ● Separate structure from behaviour
  10. 10. 10 Visitor Pattern II ● Main advantage ○ Add/Remove/Modify/Replace behaviour without changing structure. ○ Ideal when working with third party structures.
  11. 11. 11 Visitor Pattern III ● Main disadvantage ○ It’s not the ideal pattern with evolving structures.
  12. 12. 12 Visitor Pattern IV ● Visitors applied to modeling languages
  13. 13. 13 Visitor Generation Framework ● MDE based prototype to automatically apply the visitor pattern. ● Part 1. ○ Setup the DSL to apply the visitor pattern ○ via a M2M Transformation. ● Part 2. ○ Generate DSL-specific visitors framework ○ via M2T Transformations.
  14. 14. 14 Visitor Generation Framework II ● M2M transformation to prepare the DSL
  15. 15. 15 Visitor Generation Framework III ● DSL-specific visitors framework generation 1. Visitor/Visitable Interfaces ● ● ● ● ● 2. Default Abstract Implementations Contextful Visitor Null Visitor Extending Visitor Delegating Visitor ...
  16. 16. 16 Visitor Generation Framework IV ● VGF abstract visitors examples:
  17. 17. 17 Visitor Generation Framework V ● VGF Overview Visitable DSL Implementation DSL Model VGF DSL-Specific Visitors Framework Visitor/ Visitable Interfaces Manual Generated Abstract Visitors Impl. More MDE-based generators Generated Visitors Manual Visitors
  18. 18. 18 VGF for models behaviour evolution ● Evolving behaviour - Same structure Behaviour No Model Visitors Model Visitors VGF Adding Changes DSL Ok Ok Removing Breaks clients Breaks clients Breaks clients Modifying Changes DSL Ok Ok ● Evolving structure - Same behaviour Structure No Model Visitors Model Visitors VGF Adding Ok Breaks visitors Ok Removing Breaks clients Breaks clients Breaks clients Modifying Ok Ok Ok Convenient Inconvenient Very Inconvenient
  19. 19. 19 Conclusions ● VGF: ○ Automatically brings the benefits of the visitor pattern to DSLs ○ Automatically creates a DSL-specific framework to leverage visitors creation ○ It´s a convenient practice when a DSL has unclear behaviour or an evolving one ○ It may mitigate the drawbacks of the visitor pattern with respect to language structure evolution
  20. 20. Thank you very much Questions ? doubts, feedback, enquiries, etc. to asbh500@york.ac.uk
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×