oAW Presentation

  • 1,217 views
Uploaded on

A beautiful presentation on oAW

A beautiful presentation on oAW

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,217
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Pragmatic MDA: Domain Specific Languages with Eclipse Jos Warmer Partner 1
  • 2. Who, why • Expert in Model Driven Development • One of the authors of the UML standard – Main architect of OCL • 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
  • 3. Anatomy of Domain Specific Languages • The abstract syntax – The domain model or meta model • Validation rules – 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
  • 4. DSL Definition Code Validation Checks / generation Rules OCL Xtext / TMF Abstract Syntax Concrete Syntax Mapping Syntax Syntax Concrete Mapping Syntax Xpand / JET / Velocity Syntax Concrete Mapping Syntax Ecore/EMF GMF 4
  • 5. Abstract Syntax 5
  • 6. 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 – 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
  • 7. Eclipse: Ecore Runtime Ecore model Editor Editor Java Code generated EMF Edit Edit model Java Code generated generated Model Model Java Code generated
  • 8. Validation Rules 8
  • 9. Validation rules • The abstract syntax defines the structure • Which instantiations of the abstract syntax are valid? • 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
  • 10. Validation Rules in oAW / Checks Runtime Ecore model Editor Checks Edit rules Constraint Model checker 10
  • 11. Code Generation 11
  • 12. Code Generation • Makes a DSL “executable” – Can generate anything 12
  • 13. Code Generation with oAW Xpand Xpand Xpand Runtime Templates Engine Editor Java Code HTML generated Ecore XML model SQL Edit Etc. Checks Constraint Model rules checker 13
  • 14. Concrete Syntax 14
  • 15. 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 – 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 mind 15
  • 16. Concrete syntax • Textual versus graphical – … or both ! • Standalone or embedded – This presentation is about standalone only. xText: DSL's made easy • Textual: oAW Xtext Jeroen Benckhuijsen, Meinte Boersma – Alternative: TCS – Both will move (end merge) into Eclipse Textual Modeling Framework (TMF) • Visual: Graphical Modeling Framework (GMF) – No real alternatives 16
  • 17. Textual syntax: oAW Xtext generated Xtext Editor Xpand Runtime Engine Xtext Java Code Xtext Grammar Editor HTML Editor generated Xpand XML Templates SQL Edit Etc. Ecore model Constraint Model Checks checker rules 17
  • 18. Textual Concrete Syntax • Traditional parser technology – Uses parser generator tools Building a Domain • ANTRL Specific Language • JavaCC with ANTLR v3 – • Lex & Yacc Jeroen Leenarts • … – Grammar based (EBNF) 18
  • 19. Visual syntax: GMF What the developer sees Runtime Xpand Engine Xtext Java Xtext GMF Grammar Editor HTML Editor Editor generated Xpand XML Templates GMF SQL Model Etc. Edit Ecore model Constraint Model Checks checker rules 19
  • 20. Thanks and have fun ! Jos Warmer jos.warmer@ordina.nl