SlideShare a Scribd company logo
1 of 33
Domain Specific Language
generation based on
a XML Schema
13/12/2018
ÁREA DEPARTAMENTAL DE ENGENHARIA DE ELETRÓNICA E TELECOMUNICAÇÕES E DE
COMPUTADORES
MESTRADO EM ENGENHARIA INFORMÁTICA E DE COMPUTADORES
1
Author: Luís Duarte Nº 39378
Adviser: Fernando Miguel Gamboa de Carvalho
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 2
• What are they?
• External DSLs.
• XSD.
Domain Specific Languages
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 3
• What are they?
• External DSLs.
• XSD.
• Regular expressions.
Domain Specific Languages
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 4
• What are they?
• External DSLs.
• XSD.
• Regular expressions.
• Internal.
• LINQ.
Domain Specific Languages
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 5
External Domain Specific Language - HTML
Static Component
Dynamic Component
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 6
Template Engines
Apache Velocity
ASP.NE
T
Laravel Blade
CodeCharge Studio
ColdFusion
CTPP
Django
FreeMarker
eRuby
Genshi
Go
Templates
Haml
Hamlets
Thymeleaf
Smarty
Razor
PHP
Open Power
Template
Mustache
Kid
Jinja
JSP
vlibTemplat
e
WebMarc
o
Twi
g
Handlebars
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 7
• Security.
• Well formed documents.
• HTML language rule validation.
• Context object validation.
Template Engines - Issues
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 8
• Security.
• Well formed documents.
• HTML language rule validation.
• Context object validation.
• Performance.
Template Engines - Issues
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 9
• Security.
• Well formed documents.
• HTML language rule validation.
• Context object validation.
• Performance.
• Flexibility.
Template Engines - Issues
If/Else:
For:
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 10
• Security.
• Well formed documents.
• HTML language rule validation.
• Context object validation.
• Performance.
• Flexibility.
• Complexity.
Template Engines - Issues
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 11
Template Engines – The Breakthroughs
J2Html
KotlinHtml HtmlFlow1
Rocke
r
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 12
Template Engines – The Breakthroughs – J2Html
Java templates.
Well formed documents.
HTML rule validation.
Performance.
Incomplete.
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 13
Template Engines – The Breakthroughs - Rocker
Performance.
Context object validation.
Complete.
Uses text templates.
Well formed documents.
HTML rule validation.
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 14
Template Engines – The Breakthroughs - KotlinHtml
Security.
HTML rule validation.
Kotlin Templates.
Well formed documents.
Performance.
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 15
Template Engines – The Breakthroughs – HtmlFlow1
First approach at a HTML DSL.
Some HTML rule validation.
Java Templates.
Well formed documents.
Performance.
Only validates some HTML rules.
Incomplete.
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 16
Template Engines – The Breakthroughs - Summary
Functional Templates
Element Validation
Attribute Validation
Full HTML support
Well formed documents
Performance
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 17
xmlet Approach
HtmlApiFaster
XsdAsmFaster
XsdParser
1) XSD file, DSL name
2) XSD file
3) XSD element list
4) Generated classes
• Generation of a Java DSL.
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 18
• Security.
• Language Rules.
• Automation + Reuse.
• Fast.
• Avoids human error.
• Intuitive.
• Transparent.
xmlet Objectives
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 19
• Complete support to the HTML language.
• Performance.
• Maintenance.
• Templates defined as functions.
New HtmlFlow – HtmlFlow + xmlet
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 20
• Introduction.
• The motivation.
• “(...) That's about a thousand times faster than Apache Velocity.”
• Used Benchmarks.
• Spring Benchmark.
• Template Benchmark.
Benchmarks
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 21
• Approach.
• Reliability.
• Results.
Benchmarks – Spring Benchmark - Results
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 22
Benchmarks – Spring Benchmark - Results
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 23
• Approach.
• JMH.
• Results.
Benchmarks – Template Benchmark - Results
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 24
Benchmarks – Template Benchmark - Results
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 25
Benchmarks – Template Benchmark - Results
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 26
Versatility – Android Visual Layouts
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 27
Versatility – Android Visual Layouts
Android android = new Android(androidObj ->
androidObj.layout()
.linearLayout()
.attrLayoutWidth("wrap_content")
.attrLayoutHeight("wrap_content")
.attrGravity(EnumGravityLinearLayout.CENTER)
.textView()
.attrText("Hello MEIC!")
.attrLayoutWidth("wrap_content")
.attrLayoutHeight("wrap_content")
.attrTextSize("36sp")
.attrTextColor("@android:color/black")
.attrBackground("#ccddff")
.attrPadding("20dp")
.__()
.__());
String layout = android.getLayout();
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 28
Versatility – Regular Expressions
String toMatch = "regulares";
Challenge: Find all characters between ‘a’ and ‘d’ or between ‘r’ and ‘z’.
Regular Expression:
[a-d]|[r-z]
Results:
r
u
a
r
s
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 29
Versatility – Regular Expressions
String toMatch = "regulares";
Regex regex = new Regex(expr ->
expr.matchRegex()
.fromFirstUntilLast().attrFirst("a").attrLast("d")
.or()
.fromFirstUntilLast().attrFirst("r").attrLast("z"));
List<String> result = regex.match(toMatch);
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 30
• What is it?
• Element mapping.
• XSD rule validation.
Versatility – XsdParser
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 31
• HtmlFlow v3.0.
• Multiple published DSLs.
• Sub-projects with multiple usages.
Conclusions
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 32
Conclusions - Article
Article Part 1
Article Part 2
13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 33
Questions
“Template engines are a great way to build dynamic HTML pages,
but are you using the best template engine for your purposes?” - DZone

More Related Content

Similar to Domain Specific Language generation based on a XML Schema.

Oracle 12c ilm_customer_experience
Oracle 12c ilm_customer_experienceOracle 12c ilm_customer_experience
Oracle 12c ilm_customer_experienceJacques Kostic
 
Making Big Data Analytics with Hadoop fast & easy (webinar slides)
Making Big Data Analytics with Hadoop fast & easy (webinar slides)Making Big Data Analytics with Hadoop fast & easy (webinar slides)
Making Big Data Analytics with Hadoop fast & easy (webinar slides)Yellowfin
 
CADISON world Issue-1-2013
CADISON world Issue-1-2013CADISON world Issue-1-2013
CADISON world Issue-1-2013CADISON
 
System engineering capabilities of 3 dexperience platform for nuclear market ...
System engineering capabilities of 3 dexperience platform for nuclear market ...System engineering capabilities of 3 dexperience platform for nuclear market ...
System engineering capabilities of 3 dexperience platform for nuclear market ...Capgemini
 
Grand Challenges of Advanced Computing for Energy Innovation
Grand Challenges of Advanced Computing for Energy InnovationGrand Challenges of Advanced Computing for Energy Innovation
Grand Challenges of Advanced Computing for Energy InnovationMahesh Kailasam
 
Oracle BI Publisher to Transform Cloud ERP Reports
Oracle BI Publisher to Transform Cloud ERP ReportsOracle BI Publisher to Transform Cloud ERP Reports
Oracle BI Publisher to Transform Cloud ERP ReportsMahesh Vallampati
 
Optimizing Your Supply Chain with Neo4j
Optimizing Your Supply Chain with Neo4jOptimizing Your Supply Chain with Neo4j
Optimizing Your Supply Chain with Neo4jNeo4j
 
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.Sadaaki HIRAI
 
apidays London 2023 - Why and how to apply DDD to APIs, Radhouane Jrad, QBE E...
apidays London 2023 - Why and how to apply DDD to APIs, Radhouane Jrad, QBE E...apidays London 2023 - Why and how to apply DDD to APIs, Radhouane Jrad, QBE E...
apidays London 2023 - Why and how to apply DDD to APIs, Radhouane Jrad, QBE E...apidays
 
What’s in Your Data Warehouse?
What’s in Your Data Warehouse?What’s in Your Data Warehouse?
What’s in Your Data Warehouse?DATAVERSITY
 
Continuous Performance Monitoring of a Distributed Application [CON4730]
Continuous Performance Monitoring of a Distributed Application [CON4730]Continuous Performance Monitoring of a Distributed Application [CON4730]
Continuous Performance Monitoring of a Distributed Application [CON4730]Ashish Srivastava
 
Sitecore & Salesforce DMP integration
Sitecore & Salesforce DMP integrationSitecore & Salesforce DMP integration
Sitecore & Salesforce DMP integrationMichal Popelář
 
Session 2.4 virtual construction (v-con) and top braid cde – a linked data/...
Session 2.4   virtual construction (v-con) and top braid cde – a linked data/...Session 2.4   virtual construction (v-con) and top braid cde – a linked data/...
Session 2.4 virtual construction (v-con) and top braid cde – a linked data/...semanticsconference
 
Going MicroServices with Net
Going MicroServices with NetGoing MicroServices with Net
Going MicroServices with NetDavid Revoledo
 
CFD software for Product Engineers
CFD software for Product EngineersCFD software for Product Engineers
CFD software for Product EngineersDelphine Genouvrier
 
Resume_Jegatheesan-JKT
Resume_Jegatheesan-JKTResume_Jegatheesan-JKT
Resume_Jegatheesan-JKTJag Jagdeesh
 
About The Event-Driven Data Layer & Adobe Analytics
About The Event-Driven Data Layer & Adobe AnalyticsAbout The Event-Driven Data Layer & Adobe Analytics
About The Event-Driven Data Layer & Adobe AnalyticsKevin Haag
 
Cadison world-issue-01-2013
Cadison world-issue-01-2013Cadison world-issue-01-2013
Cadison world-issue-01-2013CADISON
 
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...MongoDB
 
Presentation on CASP
Presentation on CASPPresentation on CASP
Presentation on CASPvarun raj
 

Similar to Domain Specific Language generation based on a XML Schema. (20)

Oracle 12c ilm_customer_experience
Oracle 12c ilm_customer_experienceOracle 12c ilm_customer_experience
Oracle 12c ilm_customer_experience
 
Making Big Data Analytics with Hadoop fast & easy (webinar slides)
Making Big Data Analytics with Hadoop fast & easy (webinar slides)Making Big Data Analytics with Hadoop fast & easy (webinar slides)
Making Big Data Analytics with Hadoop fast & easy (webinar slides)
 
CADISON world Issue-1-2013
CADISON world Issue-1-2013CADISON world Issue-1-2013
CADISON world Issue-1-2013
 
System engineering capabilities of 3 dexperience platform for nuclear market ...
System engineering capabilities of 3 dexperience platform for nuclear market ...System engineering capabilities of 3 dexperience platform for nuclear market ...
System engineering capabilities of 3 dexperience platform for nuclear market ...
 
Grand Challenges of Advanced Computing for Energy Innovation
Grand Challenges of Advanced Computing for Energy InnovationGrand Challenges of Advanced Computing for Energy Innovation
Grand Challenges of Advanced Computing for Energy Innovation
 
Oracle BI Publisher to Transform Cloud ERP Reports
Oracle BI Publisher to Transform Cloud ERP ReportsOracle BI Publisher to Transform Cloud ERP Reports
Oracle BI Publisher to Transform Cloud ERP Reports
 
Optimizing Your Supply Chain with Neo4j
Optimizing Your Supply Chain with Neo4jOptimizing Your Supply Chain with Neo4j
Optimizing Your Supply Chain with Neo4j
 
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
 
apidays London 2023 - Why and how to apply DDD to APIs, Radhouane Jrad, QBE E...
apidays London 2023 - Why and how to apply DDD to APIs, Radhouane Jrad, QBE E...apidays London 2023 - Why and how to apply DDD to APIs, Radhouane Jrad, QBE E...
apidays London 2023 - Why and how to apply DDD to APIs, Radhouane Jrad, QBE E...
 
What’s in Your Data Warehouse?
What’s in Your Data Warehouse?What’s in Your Data Warehouse?
What’s in Your Data Warehouse?
 
Continuous Performance Monitoring of a Distributed Application [CON4730]
Continuous Performance Monitoring of a Distributed Application [CON4730]Continuous Performance Monitoring of a Distributed Application [CON4730]
Continuous Performance Monitoring of a Distributed Application [CON4730]
 
Sitecore & Salesforce DMP integration
Sitecore & Salesforce DMP integrationSitecore & Salesforce DMP integration
Sitecore & Salesforce DMP integration
 
Session 2.4 virtual construction (v-con) and top braid cde – a linked data/...
Session 2.4   virtual construction (v-con) and top braid cde – a linked data/...Session 2.4   virtual construction (v-con) and top braid cde – a linked data/...
Session 2.4 virtual construction (v-con) and top braid cde – a linked data/...
 
Going MicroServices with Net
Going MicroServices with NetGoing MicroServices with Net
Going MicroServices with Net
 
CFD software for Product Engineers
CFD software for Product EngineersCFD software for Product Engineers
CFD software for Product Engineers
 
Resume_Jegatheesan-JKT
Resume_Jegatheesan-JKTResume_Jegatheesan-JKT
Resume_Jegatheesan-JKT
 
About The Event-Driven Data Layer & Adobe Analytics
About The Event-Driven Data Layer & Adobe AnalyticsAbout The Event-Driven Data Layer & Adobe Analytics
About The Event-Driven Data Layer & Adobe Analytics
 
Cadison world-issue-01-2013
Cadison world-issue-01-2013Cadison world-issue-01-2013
Cadison world-issue-01-2013
 
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
 
Presentation on CASP
Presentation on CASPPresentation on CASP
Presentation on CASP
 

Recently uploaded

Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectErbil Polytechnic University
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Coursebim.edu.pl
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 
Autonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptAutonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptbibisarnayak0
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
Crystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxCrystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxachiever3003
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 

Recently uploaded (20)

Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction Project
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Course
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 
Autonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.pptAutonomous emergency braking system (aeb) ppt.ppt
Autonomous emergency braking system (aeb) ppt.ppt
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Crystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxCrystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptx
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 

Domain Specific Language generation based on a XML Schema.

  • 1. Domain Specific Language generation based on a XML Schema 13/12/2018 ÁREA DEPARTAMENTAL DE ENGENHARIA DE ELETRÓNICA E TELECOMUNICAÇÕES E DE COMPUTADORES MESTRADO EM ENGENHARIA INFORMÁTICA E DE COMPUTADORES 1 Author: Luís Duarte Nº 39378 Adviser: Fernando Miguel Gamboa de Carvalho
  • 2. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 2 • What are they? • External DSLs. • XSD. Domain Specific Languages
  • 3. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 3 • What are they? • External DSLs. • XSD. • Regular expressions. Domain Specific Languages
  • 4. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 4 • What are they? • External DSLs. • XSD. • Regular expressions. • Internal. • LINQ. Domain Specific Languages
  • 5. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 5 External Domain Specific Language - HTML Static Component Dynamic Component
  • 6. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 6 Template Engines Apache Velocity ASP.NE T Laravel Blade CodeCharge Studio ColdFusion CTPP Django FreeMarker eRuby Genshi Go Templates Haml Hamlets Thymeleaf Smarty Razor PHP Open Power Template Mustache Kid Jinja JSP vlibTemplat e WebMarc o Twi g Handlebars
  • 7. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 7 • Security. • Well formed documents. • HTML language rule validation. • Context object validation. Template Engines - Issues
  • 8. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 8 • Security. • Well formed documents. • HTML language rule validation. • Context object validation. • Performance. Template Engines - Issues
  • 9. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 9 • Security. • Well formed documents. • HTML language rule validation. • Context object validation. • Performance. • Flexibility. Template Engines - Issues If/Else: For:
  • 10. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 10 • Security. • Well formed documents. • HTML language rule validation. • Context object validation. • Performance. • Flexibility. • Complexity. Template Engines - Issues
  • 11. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 11 Template Engines – The Breakthroughs J2Html KotlinHtml HtmlFlow1 Rocke r
  • 12. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 12 Template Engines – The Breakthroughs – J2Html Java templates. Well formed documents. HTML rule validation. Performance. Incomplete.
  • 13. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 13 Template Engines – The Breakthroughs - Rocker Performance. Context object validation. Complete. Uses text templates. Well formed documents. HTML rule validation.
  • 14. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 14 Template Engines – The Breakthroughs - KotlinHtml Security. HTML rule validation. Kotlin Templates. Well formed documents. Performance.
  • 15. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 15 Template Engines – The Breakthroughs – HtmlFlow1 First approach at a HTML DSL. Some HTML rule validation. Java Templates. Well formed documents. Performance. Only validates some HTML rules. Incomplete.
  • 16. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 16 Template Engines – The Breakthroughs - Summary Functional Templates Element Validation Attribute Validation Full HTML support Well formed documents Performance
  • 17. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 17 xmlet Approach HtmlApiFaster XsdAsmFaster XsdParser 1) XSD file, DSL name 2) XSD file 3) XSD element list 4) Generated classes • Generation of a Java DSL.
  • 18. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 18 • Security. • Language Rules. • Automation + Reuse. • Fast. • Avoids human error. • Intuitive. • Transparent. xmlet Objectives
  • 19. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 19 • Complete support to the HTML language. • Performance. • Maintenance. • Templates defined as functions. New HtmlFlow – HtmlFlow + xmlet
  • 20. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 20 • Introduction. • The motivation. • “(...) That's about a thousand times faster than Apache Velocity.” • Used Benchmarks. • Spring Benchmark. • Template Benchmark. Benchmarks
  • 21. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 21 • Approach. • Reliability. • Results. Benchmarks – Spring Benchmark - Results
  • 22. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 22 Benchmarks – Spring Benchmark - Results
  • 23. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 23 • Approach. • JMH. • Results. Benchmarks – Template Benchmark - Results
  • 24. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 24 Benchmarks – Template Benchmark - Results
  • 25. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 25 Benchmarks – Template Benchmark - Results
  • 26. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 26 Versatility – Android Visual Layouts
  • 27. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 27 Versatility – Android Visual Layouts Android android = new Android(androidObj -> androidObj.layout() .linearLayout() .attrLayoutWidth("wrap_content") .attrLayoutHeight("wrap_content") .attrGravity(EnumGravityLinearLayout.CENTER) .textView() .attrText("Hello MEIC!") .attrLayoutWidth("wrap_content") .attrLayoutHeight("wrap_content") .attrTextSize("36sp") .attrTextColor("@android:color/black") .attrBackground("#ccddff") .attrPadding("20dp") .__() .__()); String layout = android.getLayout();
  • 28. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 28 Versatility – Regular Expressions String toMatch = "regulares"; Challenge: Find all characters between ‘a’ and ‘d’ or between ‘r’ and ‘z’. Regular Expression: [a-d]|[r-z] Results: r u a r s
  • 29. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 29 Versatility – Regular Expressions String toMatch = "regulares"; Regex regex = new Regex(expr -> expr.matchRegex() .fromFirstUntilLast().attrFirst("a").attrLast("d") .or() .fromFirstUntilLast().attrFirst("r").attrLast("z")); List<String> result = regex.match(toMatch);
  • 30. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 30 • What is it? • Element mapping. • XSD rule validation. Versatility – XsdParser
  • 31. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 31 • HtmlFlow v3.0. • Multiple published DSLs. • Sub-projects with multiple usages. Conclusions
  • 32. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 32 Conclusions - Article Article Part 1 Article Part 2
  • 33. 13/12/2018 ADEETC – MEIC - DISSERTAÇÃO 33 Questions “Template engines are a great way to build dynamic HTML pages, but are you using the best template engine for your purposes?” - DZone