oaw presentation
DESCRIPTION
A beautiful presentation on oAWTRANSCRIPT
![Page 1: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/1.jpg)
Pragmatic MDA:
Domain Specific Languages
with Eclipse
Jos Warmer
Partner
1
![Page 2: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/2.jpg)
Who, why
• Expert in Model Driven Development
• One of the authors of the UML standard
– Main architect of OCL
• Written some books• Written some books
– Praktisch UML
– MDA Explained
– Object Constraint Language
• Partner at Ordina
– Responsible for MDD
– J-Technologies � SMART-Java
– Ordina Microsoft Solutions � SMART-Microsoft
![Page 3: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/3.jpg)
Anatomy of Domain Specific
Languages
• The abstract syntax
– The domain model or meta model
• Validation rules
– What constitutes a correct model– What constitutes a correct model
• The concrete syntax or notation
– What does the language look like
• Code generation
– Making the DSL executable
– Alternative: interpretation
3
![Page 4: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/4.jpg)
DSL Definition
Abstract Concrete Syntax
Validation
Rules
Code
generation
Checks /
OCL
Xtext / TMF
Concrete
Syntax
Concrete
Syntax
4
Abstract
Syntax
Concrete
Syntax
Syntax
Mapping
Syntax
Mapping
Syntax
Mapping
Ecore/EMF
Xpand / JET
/ Velocity
GMF
![Page 5: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/5.jpg)
Abstract Syntax
5
![Page 6: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/6.jpg)
Abstract Syntax
• The abstract syntax describes the concepts of
the DSL.
– These concepts come directly from the domain
• This is the vocabulary used in the domain• This is the vocabulary used in the domain
– Often exists already with the domain experts
• Usually modeled by a class diagram like notation
– E.g. UML Class models
• Also called
– Meta model by the OMG
– Domain model by Microsoft
6
![Page 7: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/7.jpg)
Eclipse: Ecore
Ecore
modelEditor
Java Code
generated
Editor
Runtime
EMF
model
generated
Model
Java Code
Edit
Java Code
generated
generated
generated
Model
Edit
![Page 8: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/8.jpg)
Validation Rules
8
![Page 9: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/9.jpg)
Validation rules
• The abstract syntax defines the structure
• Which instantiations of the abstract syntax are
valid?
• Specified by validation rules (or well-formedness• Specified by validation rules (or well-formedness
rules)
• E.g.
– Class names must be unique
– A class may not be a generalization of itself
9
![Page 10: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/10.jpg)
Validation Rules in oAW /
Checks
Ecore
model
Editor
Runtime
10
Checks
rules
Model
Edit
Constraint
checker
![Page 11: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/11.jpg)
Code Generation
11
![Page 12: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/12.jpg)
Code Generation
• Makes a DSL “executable”
– Can generate anything
12
![Page 13: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/13.jpg)
Code Generation with oAW
Xpand
Xpand
Templates
Editor
RuntimeXpand
Engine
Java Code
13
Ecore
model
Checks
rulesModel
Edit
Constraint
checker
HTML
XML
SQL
Etc.generated
![Page 14: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/14.jpg)
Concrete Syntax
14
![Page 15: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/15.jpg)
Concrete Syntax
• Concrete Syntax defines the “look” of the DSL
– This is the only thing that users of the DSL
actually see
• Concrete syntax is also called• Concrete syntax is also called
– Notation
– Visualization
– Surface syntax
• A DSL may have more than one concrete syntax
– Different types of users may require different
concrete syntaxes
– Concrete syntax should be designed with the user
type in mind15
![Page 16: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/16.jpg)
Concrete syntax
• Textual versus graphical
– … or both !
• Standalone or embedded
– This presentation is about standalone only.– This presentation is about standalone only.
• Textual: oAW Xtext
– Alternative: TCS
– Both will move (end merge) into Eclipse Textual
Modeling Framework (TMF)
• Visual: Graphical Modeling Framework (GMF)
– No real alternatives
16
xText: DSL's made easy
Jeroen Benckhuijsen,
Meinte Boersma
![Page 17: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/17.jpg)
Textual syntax: oAW Xtext
RuntimeXpand
Engine
Java CodeXtext
Xtext
Editor
generated
17
Ecore
model
Checks
rules
Xpand
Templates
Model
Edit
Editor
Constraint
checker
Java Code
HTML
XML
SQL
Etc.
generated
Xtext
Grammar Xtext
Editor
![Page 18: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/18.jpg)
Textual Concrete Syntax
• Traditional parser technology
– Uses parser generator tools• ANTRL
• JavaCC
• Lex & Yacc
Building a Domain
Specific Language
with ANTLR v3 –
• Lex & Yacc
• …
– Grammar based (EBNF)
18
Jeroen Leenarts
![Page 19: oAW Presentation](https://reader033.vdocument.in/reader033/viewer/2022051312/547b210d5806b5e53f8b45b5/html5/thumbnails/19.jpg)
Visual syntax: GMF
Xtext
RuntimeXpand
Engine
Java
What the
developer
sees
19
Ecore
model
Checks
rules
Xpand
Templates
Xtext
Grammar
GMF
Model
Model
Edit
Editor
Constraint
checker
Java
HTML
XML
SQL
Etc.
generated
Xtext
Editor
GMF
Editor