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

What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
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.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 

Recently uploaded (20)

What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
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 ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 

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