SlideShare a Scribd company logo
1 of 21
Valerio Cosentino
Massimo Tisi
Javier Luis Canovas Izquierdo
SOFSEM, 2015, Pec pod Sněžkou, Czech Republic
A Model-Driven Approach to Generate
External DSLs from Object-Oriented
APIs
1© AtlanMod - atlanmod-contact@mines-nantes.fr
Outline
 Introduction
 Model Driven Engineering
 From API to DSL
 Conclusion and Future work
2© AtlanMod - atlanmod-contact@mines-nantes.fr
Introduction
 Code abstraction and reuse allow the use of
existing software knowledge (i.e., code
libraries) to build new software by reducing:
– Time
– Resources
– Redundancy
 Code libraries can be accessed via:
– APIs using mechanisms (function call, class
inheritance, etc.) provided by the General-
purpose Programming Language (GPL)
– DSLs (Domain Specific Languages)
3© AtlanMod - atlanmod-contact@mines-nantes.fr
Introduction
 API vs DSL:
4© AtlanMod - atlanmod-contact@mines-nantes.fr
Introduction
 Are DSLs better than APIs?[1]
– Pros:
 DSLs can be more expressive,
maintainable, concise and readable
 Static validation, syntax highlighting, etc.
 Interpretation/compilation optimized for
the DSL code execution
– Cons:
 DSLs requires a higher development
cost
[1] Kelly, S., Tolvanen, J.P.: Domain-Specific Modeling: Enabling Full Code
Generation. Wiley IEEE Computer (2008)
5© AtlanMod - atlanmod-contact@mines-nantes.fr
Introduction
 How to reduce the development cost when
building a DSL?
– Model Driven Engineering (MDE)
 Automatic generation of DSL
components:
– compiler, validator, development
environment
6© AtlanMod - atlanmod-contact@mines-nantes.fr
Model Driven Engineering
 What is MDE?
– Models: first class entities in MDE (abstract
representation of the knowledge for a given domain)
– Model transformations: operaration for model handling
 Injectors/extractors to move between technical spaces [2]
[2] Kurtev, I., Bezivin, J., Aksit, M.: Technological Spaces : an Initial
Appraisal. In: DOA. (2002) 1–6
7© AtlanMod - atlanmod-contact@mines-nantes.fr
From API to DSL
8© AtlanMod - atlanmod-contact@mines-nantes.fr
From API to DSL
9© AtlanMod - atlanmod-contact@mines-nantes.fr
From API to DSL
10© AtlanMod - atlanmod-contact@mines-nantes.fr
API classes to API metamodel
 Mapping[3]
– API class definitions  metamodel elements
– Java classes  metaclasses
 Attributes  metaclass attributes
 Methods  operations
 Customization:
– Some APIs can generate very large
metamodels
 Selection of a subset of API elements
– Tunable API metamodel
 Manual modifications
[3] Canovas Izquierdo, J.L., Jouault, F., Cabot, J., Garcıa Molina, J.:
API2MoL: Automating the building of bridges between APIs and Model-
Driven Engineering. Inform. Software Tech. 54(0) (2012) 257–273
11© AtlanMod - atlanmod-contact@mines-nantes.fr
From API to DSL
12© AtlanMod - atlanmod-contact@mines-nantes.fr
API metamodel to DSL metamodel
 Domain-specific concepts extracted from the
API metamodel
 Domain-independent API structure
– Templates
13© AtlanMod - atlanmod-contact@mines-nantes.fr
Templates
 Plain Old Data (POD)
– For simple APIs to create and maintain a
data structure
– API classes composed by getters, setters
and constructors
14© AtlanMod - atlanmod-contact@mines-nantes.fr
Templates
 Fluent
– For APIs that rely on chaining method calls
– The return values of the method calls
(keywords) are used to structure the DSL
15© AtlanMod - atlanmod-contact@mines-nantes.fr
Templates
 SimpleJava
– For APIs that do not fit in the previous
categories
– Java sub-set(statements, declarations, etc.)
16© AtlanMod - atlanmod-contact@mines-nantes.fr
From API to DSL
17© AtlanMod - atlanmod-contact@mines-nantes.fr
DSL metamodel to DSL tooling
 Bridge between the Model TS and the Grammar TS
– Mapping of metamodel elements into the grammar
rules
– Development environment
 The generation process is parameterized by:
– The DSL metamodel (concepts, attributes,
references, cardinalities, etc.)
– The template chosen (the grammar structure, the
development environment and compiler)
– Particularized for Xtext[4]
[4] Eysholdt, M., Behrens, H.: Xtext: implement your language faster than
the quick and dirty way. In: SPLASH. (2010) 307–309
18© AtlanMod - atlanmod-contact@mines-nantes.fr
From API to DSL
19© AtlanMod - atlanmod-contact@mines-nantes.fr
Compiler generation
 Since the semantics of the DSL template is
known, a DSL instance can be transformed
into its equivalent in Java
– SimpleJava
 DSL concepts have a one-to-one
correspondence with Java constructs
 DSL model to Java model (MoDisco[5])
 Java model to Java readable file (Acceleo[6])
[5] http://www.eclipse.org/gmt/modisco/technologies/J2SE5/
|6] http://www.eclipse.org/acceleo
20© AtlanMod - atlanmod-contact@mines-nantes.fr
Conclusion and Future work
 MDE approach to connect API, Model and Grammar
technical spaces
 Template mechanism to generate the resulting DSL
 Proof of concept
 Future work:
– Identify more templates to cover other types of
DSLs (API characterization)
– Study how our method could cope with more
complex APIs (event-driven, concurrent, etc.)
– Explore how distinct APIs used in the same GPL can
be combined at DSL-level (interleaving DSLs)
21© AtlanMod - atlanmod-contact@mines-nantes.fr

More Related Content

What's hot

Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case StudyLeveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case StudyLuca Berardinelli
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework OverviewDoncho Minkov
 
The REMICS model-driven process for migrating legacy applications to the cloud
The REMICS model-driven process for migrating legacy applications to the cloudThe REMICS model-driven process for migrating legacy applications to the cloud
The REMICS model-driven process for migrating legacy applications to the cloudMarcos Almeida
 
.Net Framework
.Net Framework.Net Framework
.Net FrameworkMohamadKrm
 
01 intro to programming in .net
01   intro to programming in .net01   intro to programming in .net
01 intro to programming in .netFelisha Hosein
 
CG2010 Tailored Code Generators
CG2010 Tailored Code GeneratorsCG2010 Tailored Code Generators
CG2010 Tailored Code GeneratorsPedro J. Molina
 
The secret life of rules in Software Engineering
The secret life of rules in Software EngineeringThe secret life of rules in Software Engineering
The secret life of rules in Software EngineeringJordi Cabot
 

What's hot (10)

Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case StudyLeveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
 
.Net language support
.Net language support.Net language support
.Net language support
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework Overview
 
KamalTeja_CV
KamalTeja_CVKamalTeja_CV
KamalTeja_CV
 
Introduction of .net framework
Introduction of .net frameworkIntroduction of .net framework
Introduction of .net framework
 
The REMICS model-driven process for migrating legacy applications to the cloud
The REMICS model-driven process for migrating legacy applications to the cloudThe REMICS model-driven process for migrating legacy applications to the cloud
The REMICS model-driven process for migrating legacy applications to the cloud
 
.Net Framework
.Net Framework.Net Framework
.Net Framework
 
01 intro to programming in .net
01   intro to programming in .net01   intro to programming in .net
01 intro to programming in .net
 
CG2010 Tailored Code Generators
CG2010 Tailored Code GeneratorsCG2010 Tailored Code Generators
CG2010 Tailored Code Generators
 
The secret life of rules in Software Engineering
The secret life of rules in Software EngineeringThe secret life of rules in Software Engineering
The secret life of rules in Software Engineering
 

Viewers also liked

Extracting UML/OCL Integrity Constraints and Derived Types from Relational Da...
Extracting UML/OCL Integrity Constraints and Derived Types from Relational Da...Extracting UML/OCL Integrity Constraints and Derived Types from Relational Da...
Extracting UML/OCL Integrity Constraints and Derived Types from Relational Da...Valerio Cosentino
 
Extracting Business Rules from COBOL: A Model-Based Framework
Extracting Business Rules from COBOL: A Model-Based FrameworkExtracting Business Rules from COBOL: A Model-Based Framework
Extracting Business Rules from COBOL: A Model-Based FrameworkValerio Cosentino
 
A Model Driven Reverse Engineering framework for extracting business rules ou...
A Model Driven Reverse Engineering framework for extracting business rules ou...A Model Driven Reverse Engineering framework for extracting business rules ou...
A Model Driven Reverse Engineering framework for extracting business rules ou...RuleML
 
Gitana: a SQL-based Git Repository Inspector
Gitana: a SQL-based Git Repository InspectorGitana: a SQL-based Git Repository Inspector
Gitana: a SQL-based Git Repository InspectorValerio Cosentino
 
Assessing the Bus Factor of Git Repositories
Assessing the Bus Factor of Git RepositoriesAssessing the Bus Factor of Git Repositories
Assessing the Bus Factor of Git RepositoriesValerio Cosentino
 
A Model Driven Reverse Engineering framework for extracting business rules ou...
A Model Driven Reverse Engineering framework for extracting business rules ou...A Model Driven Reverse Engineering framework for extracting business rules ou...
A Model Driven Reverse Engineering framework for extracting business rules ou...Valerio Cosentino
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 

Viewers also liked (7)

Extracting UML/OCL Integrity Constraints and Derived Types from Relational Da...
Extracting UML/OCL Integrity Constraints and Derived Types from Relational Da...Extracting UML/OCL Integrity Constraints and Derived Types from Relational Da...
Extracting UML/OCL Integrity Constraints and Derived Types from Relational Da...
 
Extracting Business Rules from COBOL: A Model-Based Framework
Extracting Business Rules from COBOL: A Model-Based FrameworkExtracting Business Rules from COBOL: A Model-Based Framework
Extracting Business Rules from COBOL: A Model-Based Framework
 
A Model Driven Reverse Engineering framework for extracting business rules ou...
A Model Driven Reverse Engineering framework for extracting business rules ou...A Model Driven Reverse Engineering framework for extracting business rules ou...
A Model Driven Reverse Engineering framework for extracting business rules ou...
 
Gitana: a SQL-based Git Repository Inspector
Gitana: a SQL-based Git Repository InspectorGitana: a SQL-based Git Repository Inspector
Gitana: a SQL-based Git Repository Inspector
 
Assessing the Bus Factor of Git Repositories
Assessing the Bus Factor of Git RepositoriesAssessing the Bus Factor of Git Repositories
Assessing the Bus Factor of Git Repositories
 
A Model Driven Reverse Engineering framework for extracting business rules ou...
A Model Driven Reverse Engineering framework for extracting business rules ou...A Model Driven Reverse Engineering framework for extracting business rules ou...
A Model Driven Reverse Engineering framework for extracting business rules ou...
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Similar to A Model-Driven Approach to Generate External DSLs from Object-Oriented APIs

Our research lines on Model-Driven Engineering and Software Engineering
Our research lines on Model-Driven Engineering and Software EngineeringOur research lines on Model-Driven Engineering and Software Engineering
Our research lines on Model-Driven Engineering and Software EngineeringJordi Cabot
 
Introducing Eclipse MoDisco
Introducing Eclipse MoDiscoIntroducing Eclipse MoDisco
Introducing Eclipse MoDiscoHugo Bruneliere
 
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. MolinaACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. MolinaPedro J. Molina
 
Documentum Spring Data
Documentum Spring DataDocumentum Spring Data
Documentum Spring DataMichael Mohen
 
jeevanreddy-nwplm
jeevanreddy-nwplmjeevanreddy-nwplm
jeevanreddy-nwplmjeevan b
 
Software Factories in the Real World: How an IBM WebSphere Integration Factor...
Software Factories in the Real World: How an IBM WebSphere Integration Factor...Software Factories in the Real World: How an IBM WebSphere Integration Factor...
Software Factories in the Real World: How an IBM WebSphere Integration Factor...ghodgkinson
 
Resume_Dimitri_Dey_LTE_Android_Gmail
Resume_Dimitri_Dey_LTE_Android_GmailResume_Dimitri_Dey_LTE_Android_Gmail
Resume_Dimitri_Dey_LTE_Android_GmailDimitri Dey
 
Csit77404
Csit77404Csit77404
Csit77404csandit
 
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingDDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingJaime Martin Losa
 
Greg Maxey - Electric Cloud - Process as Code: An Introduction to the Electri...
Greg Maxey - Electric Cloud - Process as Code: An Introduction to the Electri...Greg Maxey - Electric Cloud - Process as Code: An Introduction to the Electri...
Greg Maxey - Electric Cloud - Process as Code: An Introduction to the Electri...DevOps Enterprise Summit
 
Source-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructureSource-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructurekaveirious
 
Srinivasan resume updated
Srinivasan resume updatedSrinivasan resume updated
Srinivasan resume updatedSrinivasan V N
 
PHP modernization approach generating KDM models from PHP legacy code
PHP modernization approach generating KDM models from PHP legacy codePHP modernization approach generating KDM models from PHP legacy code
PHP modernization approach generating KDM models from PHP legacy codejournalBEEI
 
A Software Factory Integrating Rational & WebSphere Tools
A Software Factory Integrating Rational & WebSphere ToolsA Software Factory Integrating Rational & WebSphere Tools
A Software Factory Integrating Rational & WebSphere Toolsghodgkinson
 

Similar to A Model-Driven Approach to Generate External DSLs from Object-Oriented APIs (20)

Our research lines on Model-Driven Engineering and Software Engineering
Our research lines on Model-Driven Engineering and Software EngineeringOur research lines on Model-Driven Engineering and Software Engineering
Our research lines on Model-Driven Engineering and Software Engineering
 
Introducing Eclipse MoDisco
Introducing Eclipse MoDiscoIntroducing Eclipse MoDisco
Introducing Eclipse MoDisco
 
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. MolinaACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
 
Documentum Spring Data
Documentum Spring DataDocumentum Spring Data
Documentum Spring Data
 
jeevanreddy-nwplm
jeevanreddy-nwplmjeevanreddy-nwplm
jeevanreddy-nwplm
 
Prasad_CTP
Prasad_CTPPrasad_CTP
Prasad_CTP
 
Software Factories in the Real World: How an IBM WebSphere Integration Factor...
Software Factories in the Real World: How an IBM WebSphere Integration Factor...Software Factories in the Real World: How an IBM WebSphere Integration Factor...
Software Factories in the Real World: How an IBM WebSphere Integration Factor...
 
Resume_Dimitri_Dey_LTE_Android_Gmail
Resume_Dimitri_Dey_LTE_Android_GmailResume_Dimitri_Dey_LTE_Android_Gmail
Resume_Dimitri_Dey_LTE_Android_Gmail
 
Csit77404
Csit77404Csit77404
Csit77404
 
Resume
ResumeResume
Resume
 
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingDDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
 
Vimala_Gadegi
Vimala_GadegiVimala_Gadegi
Vimala_Gadegi
 
ALT
ALTALT
ALT
 
Greg Maxey - Electric Cloud - Process as Code: An Introduction to the Electri...
Greg Maxey - Electric Cloud - Process as Code: An Introduction to the Electri...Greg Maxey - Electric Cloud - Process as Code: An Introduction to the Electri...
Greg Maxey - Electric Cloud - Process as Code: An Introduction to the Electri...
 
Source-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructureSource-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructure
 
Srinivasan resume updated
Srinivasan resume updatedSrinivasan resume updated
Srinivasan resume updated
 
PHP modernization approach generating KDM models from PHP legacy code
PHP modernization approach generating KDM models from PHP legacy codePHP modernization approach generating KDM models from PHP legacy code
PHP modernization approach generating KDM models from PHP legacy code
 
A Software Factory Integrating Rational & WebSphere Tools
A Software Factory Integrating Rational & WebSphere ToolsA Software Factory Integrating Rational & WebSphere Tools
A Software Factory Integrating Rational & WebSphere Tools
 
AlekyaNyalakonda_Resume
AlekyaNyalakonda_ResumeAlekyaNyalakonda_Resume
AlekyaNyalakonda_Resume
 
Session
SessionSession
Session
 

More from Valerio Cosentino

Tracking counterfeiting on the web with python and ml
Tracking counterfeiting on the web with python and mlTracking counterfeiting on the web with python and ml
Tracking counterfeiting on the web with python and mlValerio Cosentino
 
GrimoireLab: Measuring the health of your software project with Python
GrimoireLab: Measuring the health of your software project with PythonGrimoireLab: Measuring the health of your software project with Python
GrimoireLab: Measuring the health of your software project with PythonValerio Cosentino
 
Perceval, Graal and Arthur: The Quest for Software Project Data
Perceval, Graal and Arthur: The Quest for Software Project DataPerceval, Graal and Arthur: The Quest for Software Project Data
Perceval, Graal and Arthur: The Quest for Software Project DataValerio Cosentino
 
SortingHat: Wizardry on Software Project Members
SortingHat: Wizardry on Software Project MembersSortingHat: Wizardry on Software Project Members
SortingHat: Wizardry on Software Project MembersValerio Cosentino
 
Measuring Software development with GrimoireLab
Measuring Software development with GrimoireLabMeasuring Software development with GrimoireLab
Measuring Software development with GrimoireLabValerio Cosentino
 
Graal The Quest for Source Code Knowledge
Graal  The Quest for Source Code KnowledgeGraal  The Quest for Source Code Knowledge
Graal The Quest for Source Code KnowledgeValerio Cosentino
 
Measuring Software development with GrimoireLab
Measuring Software development with GrimoireLabMeasuring Software development with GrimoireLab
Measuring Software development with GrimoireLabValerio Cosentino
 
Perceval: Software Project Data at Your Will
Perceval: Software Project Data at Your WillPerceval: Software Project Data at Your Will
Perceval: Software Project Data at Your WillValerio Cosentino
 
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...Valerio Cosentino
 

More from Valerio Cosentino (14)

Tracking counterfeiting on the web with python and ml
Tracking counterfeiting on the web with python and mlTracking counterfeiting on the web with python and ml
Tracking counterfeiting on the web with python and ml
 
GrimoireLab: Measuring the health of your software project with Python
GrimoireLab: Measuring the health of your software project with PythonGrimoireLab: Measuring the health of your software project with Python
GrimoireLab: Measuring the health of your software project with Python
 
Perceval, Graal and Arthur: The Quest for Software Project Data
Perceval, Graal and Arthur: The Quest for Software Project DataPerceval, Graal and Arthur: The Quest for Software Project Data
Perceval, Graal and Arthur: The Quest for Software Project Data
 
Gamification oss
Gamification ossGamification oss
Gamification oss
 
SortingHat: Wizardry on Software Project Members
SortingHat: Wizardry on Software Project MembersSortingHat: Wizardry on Software Project Members
SortingHat: Wizardry on Software Project Members
 
Measuring Software development with GrimoireLab
Measuring Software development with GrimoireLabMeasuring Software development with GrimoireLab
Measuring Software development with GrimoireLab
 
Graal The Quest for Source Code Knowledge
Graal  The Quest for Source Code KnowledgeGraal  The Quest for Source Code Knowledge
Graal The Quest for Source Code Knowledge
 
Measuring Software development with GrimoireLab
Measuring Software development with GrimoireLabMeasuring Software development with GrimoireLab
Measuring Software development with GrimoireLab
 
Crossminer and GrimoireLab
Crossminer and GrimoireLabCrossminer and GrimoireLab
Crossminer and GrimoireLab
 
Perceval: Software Project Data at Your Will
Perceval: Software Project Data at Your WillPerceval: Software Project Data at Your Will
Perceval: Software Project Data at Your Will
 
Extending grimoirelab
Extending grimoirelabExtending grimoirelab
Extending grimoirelab
 
Perceval
PercevalPerceval
Perceval
 
Gamification pres-scme-2017
Gamification pres-scme-2017Gamification pres-scme-2017
Gamification pres-scme-2017
 
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...
 

Recently uploaded

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
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
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
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
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
 
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
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
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
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Recently uploaded (20)

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...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
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
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
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
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
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
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
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
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

A Model-Driven Approach to Generate External DSLs from Object-Oriented APIs

  • 1. Valerio Cosentino Massimo Tisi Javier Luis Canovas Izquierdo SOFSEM, 2015, Pec pod Sněžkou, Czech Republic A Model-Driven Approach to Generate External DSLs from Object-Oriented APIs 1© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 2. Outline  Introduction  Model Driven Engineering  From API to DSL  Conclusion and Future work 2© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 3. Introduction  Code abstraction and reuse allow the use of existing software knowledge (i.e., code libraries) to build new software by reducing: – Time – Resources – Redundancy  Code libraries can be accessed via: – APIs using mechanisms (function call, class inheritance, etc.) provided by the General- purpose Programming Language (GPL) – DSLs (Domain Specific Languages) 3© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 4. Introduction  API vs DSL: 4© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 5. Introduction  Are DSLs better than APIs?[1] – Pros:  DSLs can be more expressive, maintainable, concise and readable  Static validation, syntax highlighting, etc.  Interpretation/compilation optimized for the DSL code execution – Cons:  DSLs requires a higher development cost [1] Kelly, S., Tolvanen, J.P.: Domain-Specific Modeling: Enabling Full Code Generation. Wiley IEEE Computer (2008) 5© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 6. Introduction  How to reduce the development cost when building a DSL? – Model Driven Engineering (MDE)  Automatic generation of DSL components: – compiler, validator, development environment 6© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 7. Model Driven Engineering  What is MDE? – Models: first class entities in MDE (abstract representation of the knowledge for a given domain) – Model transformations: operaration for model handling  Injectors/extractors to move between technical spaces [2] [2] Kurtev, I., Bezivin, J., Aksit, M.: Technological Spaces : an Initial Appraisal. In: DOA. (2002) 1–6 7© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 8. From API to DSL 8© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 9. From API to DSL 9© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 10. From API to DSL 10© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 11. API classes to API metamodel  Mapping[3] – API class definitions  metamodel elements – Java classes  metaclasses  Attributes  metaclass attributes  Methods  operations  Customization: – Some APIs can generate very large metamodels  Selection of a subset of API elements – Tunable API metamodel  Manual modifications [3] Canovas Izquierdo, J.L., Jouault, F., Cabot, J., Garcıa Molina, J.: API2MoL: Automating the building of bridges between APIs and Model- Driven Engineering. Inform. Software Tech. 54(0) (2012) 257–273 11© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 12. From API to DSL 12© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 13. API metamodel to DSL metamodel  Domain-specific concepts extracted from the API metamodel  Domain-independent API structure – Templates 13© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 14. Templates  Plain Old Data (POD) – For simple APIs to create and maintain a data structure – API classes composed by getters, setters and constructors 14© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 15. Templates  Fluent – For APIs that rely on chaining method calls – The return values of the method calls (keywords) are used to structure the DSL 15© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 16. Templates  SimpleJava – For APIs that do not fit in the previous categories – Java sub-set(statements, declarations, etc.) 16© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 17. From API to DSL 17© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 18. DSL metamodel to DSL tooling  Bridge between the Model TS and the Grammar TS – Mapping of metamodel elements into the grammar rules – Development environment  The generation process is parameterized by: – The DSL metamodel (concepts, attributes, references, cardinalities, etc.) – The template chosen (the grammar structure, the development environment and compiler) – Particularized for Xtext[4] [4] Eysholdt, M., Behrens, H.: Xtext: implement your language faster than the quick and dirty way. In: SPLASH. (2010) 307–309 18© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 19. From API to DSL 19© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 20. Compiler generation  Since the semantics of the DSL template is known, a DSL instance can be transformed into its equivalent in Java – SimpleJava  DSL concepts have a one-to-one correspondence with Java constructs  DSL model to Java model (MoDisco[5])  Java model to Java readable file (Acceleo[6]) [5] http://www.eclipse.org/gmt/modisco/technologies/J2SE5/ |6] http://www.eclipse.org/acceleo 20© AtlanMod - atlanmod-contact@mines-nantes.fr
  • 21. Conclusion and Future work  MDE approach to connect API, Model and Grammar technical spaces  Template mechanism to generate the resulting DSL  Proof of concept  Future work: – Identify more templates to cover other types of DSLs (API characterization) – Study how our method could cope with more complex APIs (event-driven, concurrent, etc.) – Explore how distinct APIs used in the same GPL can be combined at DSL-level (interleaving DSLs) 21© AtlanMod - atlanmod-contact@mines-nantes.fr