SlideShare una empresa de Scribd logo
1 de 18
Software Architecture 
School of Computer Science University of Oviedo 
University of Oviedo 
Software Architecture 
Part III 
Class #2 
Creating a domain-specific 
language 
2014 Vicente García Díaz
Software Architecture 
School of Computer Science University of Oviedo 
What is a domain-specific language? 
• It is a programming language that focuses only on a 
particular domain 
• The domain can be anything 
• Opposite ideas 
▫ General-Purpose Language (GPL) 
 Java, C, C++, C#, Python, UML, … 
▫ Domain-Specific Language (DSL) 
 CSS, HTML, SQL 
2
Software Architecture 
School of Computer Science University of Oviedo 
Classification (I) 
• From the point of view of how the language is 
3 
Textuals Graphicals
Software Architecture 
School of Computer Science University of Oviedo 
Classification (II) 
• From the point of view of the problem domain 
4 
Horizontals Verticals
Software Architecture 
School of Computer Science University of Oviedo 
Stakeholders 
5 
Engineers 
Developers 
Clients
Software Architecture 
School of Computer Science University of Oviedo 
Limits 
• It is desirable to set limits to determine which parts 
of the system will be created with a DSL and which 
parts will not 
• Sometimes it is better to use a GPL and other times 
it is better to use a DSL 
• Using DLSs has both advantages and 
disadvantages 
6
Software Architecture 
School of Computer Science University of Oviedo 
Benefits of using DSLs 
1. With a DSL, it is more difficult to make mistakes 
in the representation of a problem domain 
2. Working with the terms of a specific domain 
facilitates the understanding of the models that 
represents the software to non-experts in 
computer technology development 
3. When knowledge of a particular domain is 
7 
captured in a model, it becomes much easier to 
perform migrations between different technologies
Software Architecture 
School of Computer Science University of Oviedo 
Drawbacks of using DSLs 
1. Research time to define and design the DSL that 
will be created 
2. Cost required to test the DSL 
3. Additional difficulties in the application 
deployment 
4. Need for additional documentation 
5. Preparation of the development team 
8
Software Architecture 
School of Computer Science University of Oviedo 
How a DSL is usually created? 
• They are usually created using parser generators 
▫ From a grammar they obtain the parser 
▫ ANTLR, JavaCC, Lexx/yacc, … 
• The parser validates the text 
and created a tree 
▫ It is usually an Abstract 
Syntax Tree (AST) 
9 
addition 
5*6 + 25 
multiplication literal 
literal literal 
5 6 25
Software Architecture 
School of Computer Science University of Oviedo 
A difficult task 
• Writing a parser is a difficult task 
▫ Even using tools like ANTLR 
• …a we would still need: 
▫ Creating a development environment for the language 
▫ Transform the AST in “something” from which we are able 
to generate code 
• It is better not to do it “by hand” 
▫ Textual Modeling Framework  we will focus on 
▫ Graphical Modeling Framework 
10
Software Architecture 
School of Computer Science University of Oviedo 
What is Xtext? 
• It is a tool to build DSLs or even GPLs 
• It automatically generates various artifacts from a 
LL(*) grammar 
▫ A parser 
▫ A Ecore metamodel 
▫ An IDE for Eclipse 
 Syntax highlighting 
 Assistance in completing sentences 
 Overview window 
 Checking of constrains in real time 
11 
DSL Project 
Generador 
Xtext 
Metamodelo 
Ecore 
Gramática Xtext 
(Petri.xtext) 
Parser ANTLR 
Editor Plug-in 
Proyecto del DSL “Petri” 
Proyecto UI 
Xtext 
grammar 
ANTL 
Parser 
Ecore 
metamodel 
Pluging 
for 
Eclipse 
Xtext 
generator
Software Architecture 
School of Computer Science University of Oviedo 
What is our goal with Xtext? 
1. Creating a domain-specific language (textual) 
based on Xtext 
2. Creating programs (models) using the created 
language 
3. Generaring artifacts from the models (e.g., Java 
12 
source code, HTML, plain text, assembly code, …)
Software Architecture 
School of Computer Science University of Oviedo 
Developing process with Xtext 
1. Part I. Creation of the language 
▫ Step 1. Creating a Xtext Project in Eclipse 
▫ Step 2. Defining the gramar of the language…and many 
other things 
▫ Step 3. Generating the language of all of its components 
2. Part II. Creation of programs (models) with the new 
language 
▫ Step 1. Opening the development environment of the 
language 
▫ Step 2. Creating a program for the new language using 
the development environment 
3. Part III. Generation of artifacts from the models 
13
Software Architecture 
School of Computer Science University of Oviedo 
Installing the environment. Option 1 
• Download Eclipse for Xtext 
• http://www.eclipse.org/Xtext/download.html 
14
Software Architecture 
School of Computer Science University of Oviedo 
Installing the environment. Option 2 
15 
• Download Eclipse Modeling Tools 
• http://www.eclipse.org/downloads/packages/eclips 
e-modeling-tools/lunasr1
Software Architecture 
School of Computer Science University of Oviedo 
Installing the environment. Option 3 
• Install Xtext as a plugin for the Eclipse IDE 
16
Software Architecture 
School of Computer Science University of Oviedo
Software Architecture 
School of Computer Science University of Oviedo 
Creating a domain-specific language 
Thank you

Más contenido relacionado

La actualidad más candente

Introduction to iOS and Objective-C
Introduction to iOS and Objective-CIntroduction to iOS and Objective-C
Introduction to iOS and Objective-CDaniela Da Cruz
 
.Net framework interview questions
.Net framework interview questions.Net framework interview questions
.Net framework interview questionsMir Majid
 
Software Technologies for the Interoperability, Reusability and Adaptability...
Software Technologies for the Interoperability,  Reusability and Adaptability...Software Technologies for the Interoperability,  Reusability and Adaptability...
Software Technologies for the Interoperability, Reusability and Adaptability...Daniele Gianni
 
A Rubric For District Robotics Success: A Buyer's Guide & Hands On Experience...
A Rubric For District Robotics Success: A Buyer's Guide & Hands On Experience...A Rubric For District Robotics Success: A Buyer's Guide & Hands On Experience...
A Rubric For District Robotics Success: A Buyer's Guide & Hands On Experience...Dr. Daniel Downs
 
Creative Ant Farm project report (2002)
Creative Ant Farm project report (2002)Creative Ant Farm project report (2002)
Creative Ant Farm project report (2002)Amir Dotan
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharpJayanta Basak
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...Maarten Balliauw
 
Comparative Study of programming Languages
Comparative Study of programming LanguagesComparative Study of programming Languages
Comparative Study of programming LanguagesIshan Monga
 
international PHP2011_Kore Nordmann_Designing multilingual applications
international PHP2011_Kore Nordmann_Designing multilingual applications international PHP2011_Kore Nordmann_Designing multilingual applications
international PHP2011_Kore Nordmann_Designing multilingual applications smueller_sandsmedia
 

La actualidad más candente (20)

Introduction to iOS and Objective-C
Introduction to iOS and Objective-CIntroduction to iOS and Objective-C
Introduction to iOS and Objective-C
 
Introduction to C# Programming
Introduction to C# ProgrammingIntroduction to C# Programming
Introduction to C# Programming
 
.Net framework interview questions
.Net framework interview questions.Net framework interview questions
.Net framework interview questions
 
Software Technologies for the Interoperability, Reusability and Adaptability...
Software Technologies for the Interoperability,  Reusability and Adaptability...Software Technologies for the Interoperability,  Reusability and Adaptability...
Software Technologies for the Interoperability, Reusability and Adaptability...
 
ewili13_submission_14
ewili13_submission_14ewili13_submission_14
ewili13_submission_14
 
A Rubric For District Robotics Success: A Buyer's Guide & Hands On Experience...
A Rubric For District Robotics Success: A Buyer's Guide & Hands On Experience...A Rubric For District Robotics Success: A Buyer's Guide & Hands On Experience...
A Rubric For District Robotics Success: A Buyer's Guide & Hands On Experience...
 
Difference between c, c++ and java
Difference between c, c++ and javaDifference between c, c++ and java
Difference between c, c++ and java
 
Metamorphic Domain-Specific Languages
Metamorphic Domain-Specific LanguagesMetamorphic Domain-Specific Languages
Metamorphic Domain-Specific Languages
 
Unit i
Unit iUnit i
Unit i
 
Creative Ant Farm project report (2002)
Creative Ant Farm project report (2002)Creative Ant Farm project report (2002)
Creative Ant Farm project report (2002)
 
C# chap 1
C# chap 1C# chap 1
C# chap 1
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
56 o oo ccf_final
56 o oo ccf_final56 o oo ccf_final
56 o oo ccf_final
 
201010 SPLASH Tutorial
201010 SPLASH Tutorial201010 SPLASH Tutorial
201010 SPLASH Tutorial
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
 
Comparative Study of programming Languages
Comparative Study of programming LanguagesComparative Study of programming Languages
Comparative Study of programming Languages
 
international PHP2011_Kore Nordmann_Designing multilingual applications
international PHP2011_Kore Nordmann_Designing multilingual applications international PHP2011_Kore Nordmann_Designing multilingual applications
international PHP2011_Kore Nordmann_Designing multilingual applications
 
Reproducible Science and Deep Software Variability
Reproducible Science and Deep Software VariabilityReproducible Science and Deep Software Variability
Reproducible Science and Deep Software Variability
 
Lecture # 1
Lecture # 1Lecture # 1
Lecture # 1
 
VMPaper
VMPaperVMPaper
VMPaper
 

Similar a Creating a textual domain specific language

Introduction to architectures based on models, models and metamodels. model d...
Introduction to architectures based on models, models and metamodels. model d...Introduction to architectures based on models, models and metamodels. model d...
Introduction to architectures based on models, models and metamodels. model d...Vicente García Díaz
 
Top 10 programming languages
Top 10 programming languagesTop 10 programming languages
Top 10 programming languagesAman Kumar
 
JavaHTP7e_0101_DDP.ppt
JavaHTP7e_0101_DDP.pptJavaHTP7e_0101_DDP.ppt
JavaHTP7e_0101_DDP.pptDrTouseefTahir
 
Synapse india fundamentals of dotnet development
Synapse india fundamentals of dotnet  developmentSynapse india fundamentals of dotnet  development
Synapse india fundamentals of dotnet developmentSynapseindiappsdevelopment
 
Advance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfAdvance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfpercivalfernandez2
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxpercivalfernandez3
 
Top programming Languages in software Industry companies
Top programming Languages in software Industry companiesTop programming Languages in software Industry companies
Top programming Languages in software Industry companiesKiran Patil
 
CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)Dilawar Khan
 
Domain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsDomain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsMark Windholtz
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxshashiden1
 
Domain specific modelling (DSM)
Domain specific modelling (DSM)Domain specific modelling (DSM)
Domain specific modelling (DSM)PG Scholar
 
Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?NIIT India
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.netsuraj pandey
 

Similar a Creating a textual domain specific language (20)

Introduction to architectures based on models, models and metamodels. model d...
Introduction to architectures based on models, models and metamodels. model d...Introduction to architectures based on models, models and metamodels. model d...
Introduction to architectures based on models, models and metamodels. model d...
 
Top 10 programming languages
Top 10 programming languagesTop 10 programming languages
Top 10 programming languages
 
JavaHTP7e_0101_DDP.ppt
JavaHTP7e_0101_DDP.pptJavaHTP7e_0101_DDP.ppt
JavaHTP7e_0101_DDP.ppt
 
Synapse india fundamentals of dotnet development
Synapse india fundamentals of dotnet  developmentSynapse india fundamentals of dotnet  development
Synapse india fundamentals of dotnet development
 
Advance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfAdvance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdf
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptx
 
Top programming Languages in software Industry companies
Top programming Languages in software Industry companiesTop programming Languages in software Industry companies
Top programming Languages in software Industry companies
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)
 
Asp.net new
Asp.net newAsp.net new
Asp.net new
 
Java basics
Java basicsJava basics
Java basics
 
Session i
Session iSession i
Session i
 
Domain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsDomain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic Patterns
 
Intro1
Intro1Intro1
Intro1
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
 
Programming landuages
Programming landuagesProgramming landuages
Programming landuages
 
Domain specific modelling (DSM)
Domain specific modelling (DSM)Domain specific modelling (DSM)
Domain specific modelling (DSM)
 
Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
 
Evolution and History of Programming Languages - Software/Hardware/System
Evolution and History of Programming Languages - Software/Hardware/SystemEvolution and History of Programming Languages - Software/Hardware/System
Evolution and History of Programming Languages - Software/Hardware/System
 

Más de Vicente García Díaz (15)

jBPM
jBPMjBPM
jBPM
 
Wikitude. KML y ARML
Wikitude. KML y ARMLWikitude. KML y ARML
Wikitude. KML y ARML
 
Wikitude. ARchiect
Wikitude. ARchiectWikitude. ARchiect
Wikitude. ARchiect
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
Introducción a la ingeniería dirigida por modelos
Introducción a la ingeniería dirigida por modelosIntroducción a la ingeniería dirigida por modelos
Introducción a la ingeniería dirigida por modelos
 
Iniciación a OpenGL
Iniciación a OpenGLIniciación a OpenGL
Iniciación a OpenGL
 
Iniciación a la realidad aumentada
Iniciación a la realidad aumentadaIniciación a la realidad aumentada
Iniciación a la realidad aumentada
 
Iniciación a ARToolKit
Iniciación a ARToolKitIniciación a ARToolKit
Iniciación a ARToolKit
 
Desarrollo robótico - Robot Operating System (ROS)
Desarrollo robótico - Robot Operating System (ROS)Desarrollo robótico - Robot Operating System (ROS)
Desarrollo robótico - Robot Operating System (ROS)
 
Wikitude. Servicios Seb
Wikitude. Servicios SebWikitude. Servicios Seb
Wikitude. Servicios Seb
 
LaTeX
LaTeXLaTeX
LaTeX
 
Automatización y Microsoft Word
Automatización y Microsoft WordAutomatización y Microsoft Word
Automatización y Microsoft Word
 
Árboles
ÁrbolesÁrboles
Árboles
 
Dispersión y tablas hash
Dispersión y tablas hashDispersión y tablas hash
Dispersión y tablas hash
 
Grafos
GrafosGrafos
Grafos
 

Último

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Último (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Creating a textual domain specific language

  • 1. Software Architecture School of Computer Science University of Oviedo University of Oviedo Software Architecture Part III Class #2 Creating a domain-specific language 2014 Vicente García Díaz
  • 2. Software Architecture School of Computer Science University of Oviedo What is a domain-specific language? • It is a programming language that focuses only on a particular domain • The domain can be anything • Opposite ideas ▫ General-Purpose Language (GPL)  Java, C, C++, C#, Python, UML, … ▫ Domain-Specific Language (DSL)  CSS, HTML, SQL 2
  • 3. Software Architecture School of Computer Science University of Oviedo Classification (I) • From the point of view of how the language is 3 Textuals Graphicals
  • 4. Software Architecture School of Computer Science University of Oviedo Classification (II) • From the point of view of the problem domain 4 Horizontals Verticals
  • 5. Software Architecture School of Computer Science University of Oviedo Stakeholders 5 Engineers Developers Clients
  • 6. Software Architecture School of Computer Science University of Oviedo Limits • It is desirable to set limits to determine which parts of the system will be created with a DSL and which parts will not • Sometimes it is better to use a GPL and other times it is better to use a DSL • Using DLSs has both advantages and disadvantages 6
  • 7. Software Architecture School of Computer Science University of Oviedo Benefits of using DSLs 1. With a DSL, it is more difficult to make mistakes in the representation of a problem domain 2. Working with the terms of a specific domain facilitates the understanding of the models that represents the software to non-experts in computer technology development 3. When knowledge of a particular domain is 7 captured in a model, it becomes much easier to perform migrations between different technologies
  • 8. Software Architecture School of Computer Science University of Oviedo Drawbacks of using DSLs 1. Research time to define and design the DSL that will be created 2. Cost required to test the DSL 3. Additional difficulties in the application deployment 4. Need for additional documentation 5. Preparation of the development team 8
  • 9. Software Architecture School of Computer Science University of Oviedo How a DSL is usually created? • They are usually created using parser generators ▫ From a grammar they obtain the parser ▫ ANTLR, JavaCC, Lexx/yacc, … • The parser validates the text and created a tree ▫ It is usually an Abstract Syntax Tree (AST) 9 addition 5*6 + 25 multiplication literal literal literal 5 6 25
  • 10. Software Architecture School of Computer Science University of Oviedo A difficult task • Writing a parser is a difficult task ▫ Even using tools like ANTLR • …a we would still need: ▫ Creating a development environment for the language ▫ Transform the AST in “something” from which we are able to generate code • It is better not to do it “by hand” ▫ Textual Modeling Framework  we will focus on ▫ Graphical Modeling Framework 10
  • 11. Software Architecture School of Computer Science University of Oviedo What is Xtext? • It is a tool to build DSLs or even GPLs • It automatically generates various artifacts from a LL(*) grammar ▫ A parser ▫ A Ecore metamodel ▫ An IDE for Eclipse  Syntax highlighting  Assistance in completing sentences  Overview window  Checking of constrains in real time 11 DSL Project Generador Xtext Metamodelo Ecore Gramática Xtext (Petri.xtext) Parser ANTLR Editor Plug-in Proyecto del DSL “Petri” Proyecto UI Xtext grammar ANTL Parser Ecore metamodel Pluging for Eclipse Xtext generator
  • 12. Software Architecture School of Computer Science University of Oviedo What is our goal with Xtext? 1. Creating a domain-specific language (textual) based on Xtext 2. Creating programs (models) using the created language 3. Generaring artifacts from the models (e.g., Java 12 source code, HTML, plain text, assembly code, …)
  • 13. Software Architecture School of Computer Science University of Oviedo Developing process with Xtext 1. Part I. Creation of the language ▫ Step 1. Creating a Xtext Project in Eclipse ▫ Step 2. Defining the gramar of the language…and many other things ▫ Step 3. Generating the language of all of its components 2. Part II. Creation of programs (models) with the new language ▫ Step 1. Opening the development environment of the language ▫ Step 2. Creating a program for the new language using the development environment 3. Part III. Generation of artifacts from the models 13
  • 14. Software Architecture School of Computer Science University of Oviedo Installing the environment. Option 1 • Download Eclipse for Xtext • http://www.eclipse.org/Xtext/download.html 14
  • 15. Software Architecture School of Computer Science University of Oviedo Installing the environment. Option 2 15 • Download Eclipse Modeling Tools • http://www.eclipse.org/downloads/packages/eclips e-modeling-tools/lunasr1
  • 16. Software Architecture School of Computer Science University of Oviedo Installing the environment. Option 3 • Install Xtext as a plugin for the Eclipse IDE 16
  • 17. Software Architecture School of Computer Science University of Oviedo
  • 18. Software Architecture School of Computer Science University of Oviedo Creating a domain-specific language Thank you