SlideShare a Scribd company logo
1 of 16
Download to read offline
Hamza Ed-douibi, Javier Luis Cánovas
Izquierdo, Abel Gómez, Massimo Tisi, Jordi
Cabot
EMF-REST: Generation of RESTful
APIs from Models
1
ACM SAC 2016 - Pisa, Italy.
07/04/2016
EMF-REST: Generation of RESTful APIs
from Models
2
 The Model-driven engineering paradigm emphasizes the use of
models to raise the level of abstraction and to (semi)automate the
development of software.
Abstraction
Automation
MDE
Standar-
dization
 The Eclipse Modeling Framework (EMF) is the foundation for
modeling and data integration at Eclipse. (Models are described using
the Ecore language)
EMF-REST: Generation of RESTful APIs
from Models
3
Addressable resources (URI)
Representation-oriented (JSON,XML)
Statelessness
Uniform and Constrained Interface
Representational State Transfer (REST) is an architectural style
that specifies constraints such as:
Java
Environment
XMI
EMF-REST proposal
4
JAVA
+
Web
Environment
JAVASCRIPT
+
REST API
EMF-REST
EMF-REST benefits
5
Collaboration Scalability
Portability
EMF-REST approach
 EMF-REST generates RESTful Web APIs out of EMF
models.
 The generated API provides a direct mapping to
access data models following the REST principles :
– Addressable resources (URI)
– Representation-oriented (JSON,XML)
– Statelessness
– Uniform and Constrained Interface (HTTP verbs :
GET, POST,…)
 The generated application supports validation and
security.
 The generated RESTful Web API relies on well-known
libraries and standards.
6
EMF-REST features
7
REST API JSON Serialization XML Serialization
Validation Security
Running Example
8
IFML (Interaction Flow Modeling Language) model: A
form from a movie manager
Mapping EMF with REST
EMF
EMF-REST
9
Addressable resources
1. platform:/resource/project/AddMovie.xmi
2. platform:/resource/project/AddMovie.xmi#title
3. platform:/resource/project/AddMovie.xmi#//.../@viewComponentsParts.0
1. https://example.com/rest/IFMLModel/AddMovie
2. https://example.com/rest/IFMLModel/.../viewComponentsParts/title
3. https://example.com/rest/IFMLModel/.../viewComponentsParts?index=0
Mapping EMF with REST
XML JSON
10
Representation-Oriented
<form>
<name>AddMovieForm</name>
<viewComponentParts>
<simpleField>
<uri>https://example.com/.../
viewComponentsParts/picture</uri>
</simpleField>
<simpleField>
<uri>https://example.com/.../
viewComponentsParts/title</uri>
</simpleField>
...
</viewComponentParts>
<viewElementEvents>
<onSubmitEvent>
<uri>https://example.com/.../
viewElementEvents/add</uri>
</onSubmitEvent>
</viewElementEvents>
</form>
{
"form":{
"name":"addMovieForm",
"viewComponentParts":{
"simpleField":[
{
"uri":"https://.../
viewComponentsParts/picture"
},
{
"uri":"https://.../
viewComponentsParts/title"
}
,…]
},
"viewElementEvents":{
"onsubmitevent":{
"uri":"https://.../
viewelementevents/add"
}
}
}
}
Mapping EMF with REST: Uniform and
Constrained Interface & Statelessness
EMF
EMF-REST
11
PUT https :// example .com/rest/IFMLModel/AddMovie/
interactionFlowElements/AddMovieWindow/
viewElements /AddMovieForm
{"form":{
name :"toto"
}
}
addMovieFormObj . setName (" toto ");
//addMovieFormObj is of type Form
Extra features
 Validation
– Use of OCL annotations to enable validation each time the API is called
 Security
– Encryption: All the communications with the server are using HTTPS
– Authentication: Only authenticated users are allowed to access the API
– Authorization: Use of a Role-based mechanism to assign permissions for
each operation.
– Use of model annotations to support authentication and authorization
12
Architecture of EMF-REST generated application
13
EMF
JAX-RS
EJB/CDI
JAXB OCL JPA
JavaScript API
Browser
REST Client
Validation SecurityContent management
Web ClientWeb Application
EMF-REST generation process
14
Conclusion & future work
 EMF-REST generates truly RESTful APIs for EMF
models by mapping data models with REST
principles.
 EMF-REST complements the existing (Java-based) API
generation facilities EMF already provides and
extends them to the Web.
 Future work:
– Storage configuration
– Configuration of the generated API
– Definition of how model elements should be
serialized.
15
Thank you!
16
• Visit us at:
http://som-
research.uoc.edu/tools/emf-rest/
• Hamza Ed-douibi:
hed-douibi@uoc.edu
•Javier Cánovas:
jcanovasi@uoc.edu
•Jordi Cabot:
jordi.cabot@icrea.cat

More Related Content

What's hot

End-to-end Model-driven Development of Applications with Eclipse using the ...
End-to-end Model-driven Development of Applications with Eclipse using  the ...End-to-end Model-driven Development of Applications with Eclipse using  the ...
End-to-end Model-driven Development of Applications with Eclipse using the ...
emanuelemolteni
 
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
Marco Brambilla
 
Model Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & FutureModel Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & Future
elliando dias
 
5 - Architetture Software - Metamodelling and the Model Driven Architecture
5 - Architetture Software - Metamodelling and the Model Driven Architecture5 - Architetture Software - Metamodelling and the Model Driven Architecture
5 - Architetture Software - Metamodelling and the Model Driven Architecture
Majong DevJfu
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...
Marco Brambilla
 

What's hot (20)

End-to-end Model-driven Development of Applications with Eclipse using the ...
End-to-end Model-driven Development of Applications with Eclipse using  the ...End-to-end Model-driven Development of Applications with Eclipse using  the ...
End-to-end Model-driven Development of Applications with Eclipse using the ...
 
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
 
XML Unit 01
XML Unit 01XML Unit 01
XML Unit 01
 
WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)
 
Mobile extensions for OMG's IFML modeling language presented at MobiWIS confe...
Mobile extensions for OMG's IFML modeling language presented at MobiWIS confe...Mobile extensions for OMG's IFML modeling language presented at MobiWIS confe...
Mobile extensions for OMG's IFML modeling language presented at MobiWIS confe...
 
.Net
.Net.Net
.Net
 
MDD and modeling tools research
MDD and modeling tools researchMDD and modeling tools research
MDD and modeling tools research
 
Model Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & FutureModel Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & Future
 
Introduction to MDA
Introduction to MDAIntroduction to MDA
Introduction to MDA
 
Model driven architecture
Model driven architectureModel driven architecture
Model driven architecture
 
MDA
MDAMDA
MDA
 
Bt0083, server side programming theory
Bt0083, server side programming theoryBt0083, server side programming theory
Bt0083, server side programming theory
 
Bt0083, server side programming theory
Bt0083, server side programming theoryBt0083, server side programming theory
Bt0083, server side programming theory
 
Intro To AOP
Intro To AOPIntro To AOP
Intro To AOP
 
Mule edifact module
Mule edifact moduleMule edifact module
Mule edifact module
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
 
5 - Architetture Software - Metamodelling and the Model Driven Architecture
5 - Architetture Software - Metamodelling and the Model Driven Architecture5 - Architetture Software - Metamodelling and the Model Driven Architecture
5 - Architetture Software - Metamodelling and the Model Driven Architecture
 
Automatic code generation for cross platform, multi-device mobile apps. An in...
Automatic code generation for cross platform, multi-device mobile apps. An in...Automatic code generation for cross platform, multi-device mobile apps. An in...
Automatic code generation for cross platform, multi-device mobile apps. An in...
 
ISI Institute E-Services Chapter 4
ISI Institute E-Services Chapter 4ISI Institute E-Services Chapter 4
ISI Institute E-Services Chapter 4
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...
 

Viewers also liked

S01 e01 schema-design
S01 e01 schema-designS01 e01 schema-design
S01 e01 schema-design
MongoDB
 
Model-driven Software Engineering in practice: Chapter 3 - MDSE Use cases
Model-driven Software Engineering in practice: Chapter 3 - MDSE Use casesModel-driven Software Engineering in practice: Chapter 3 - MDSE Use cases
Model-driven Software Engineering in practice: Chapter 3 - MDSE Use cases
Jordi Cabot
 
CPI Summit Europe Presentation
CPI Summit Europe PresentationCPI Summit Europe Presentation
CPI Summit Europe Presentation
Scott Songer
 
Model-Driven Software Engineering in Practice - Chapter 5 - Integration of Mo...
Model-Driven Software Engineering in Practice - Chapter 5 - Integration of Mo...Model-Driven Software Engineering in Practice - Chapter 5 - Integration of Mo...
Model-Driven Software Engineering in Practice - Chapter 5 - Integration of Mo...
Marco Brambilla
 
Model-Driven Software Engineering in Practice - Chapter 2 - MDSE Principles
Model-Driven Software Engineering in Practice - Chapter 2 - MDSE PrinciplesModel-Driven Software Engineering in Practice - Chapter 2 - MDSE Principles
Model-Driven Software Engineering in Practice - Chapter 2 - MDSE Principles
Marco Brambilla
 
Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...
Marco Brambilla
 
Model driven software engineering in practice book - chapter 7 - Developing y...
Model driven software engineering in practice book - chapter 7 - Developing y...Model driven software engineering in practice book - chapter 7 - Developing y...
Model driven software engineering in practice book - chapter 7 - Developing y...
Marco Brambilla
 

Viewers also liked (20)

OCL tutorial
OCL tutorial OCL tutorial
OCL tutorial
 
S01 e01 schema-design
S01 e01 schema-designS01 e01 schema-design
S01 e01 schema-design
 
SECON'2016. Алексеев Олег, Живой API
SECON'2016. Алексеев Олег, Живой APISECON'2016. Алексеев Олег, Живой API
SECON'2016. Алексеев Олег, Живой API
 
Idm et ihm
Idm et ihmIdm et ihm
Idm et ihm
 
Document your rest api using swagger - Devoxx 2015
Document your rest api using swagger - Devoxx 2015Document your rest api using swagger - Devoxx 2015
Document your rest api using swagger - Devoxx 2015
 
Model-driven Software Engineering in practice: Chapter 3 - MDSE Use cases
Model-driven Software Engineering in practice: Chapter 3 - MDSE Use casesModel-driven Software Engineering in practice: Chapter 3 - MDSE Use cases
Model-driven Software Engineering in practice: Chapter 3 - MDSE Use cases
 
CPI Summit Europe Presentation
CPI Summit Europe PresentationCPI Summit Europe Presentation
CPI Summit Europe Presentation
 
Banking and Mobile Identity
Banking and Mobile IdentityBanking and Mobile Identity
Banking and Mobile Identity
 
Enhancing your Security APIs
Enhancing your Security APIsEnhancing your Security APIs
Enhancing your Security APIs
 
What's better than Microservices? Serverless Microservices
What's better than Microservices? Serverless MicroservicesWhat's better than Microservices? Serverless Microservices
What's better than Microservices? Serverless Microservices
 
Model-Driven Software Engineering in Practice - Chapter 5 - Integration of Mo...
Model-Driven Software Engineering in Practice - Chapter 5 - Integration of Mo...Model-Driven Software Engineering in Practice - Chapter 5 - Integration of Mo...
Model-Driven Software Engineering in Practice - Chapter 5 - Integration of Mo...
 
Model-Driven Software Engineering in Practice - Chapter 2 - MDSE Principles
Model-Driven Software Engineering in Practice - Chapter 2 - MDSE PrinciplesModel-Driven Software Engineering in Practice - Chapter 2 - MDSE Principles
Model-Driven Software Engineering in Practice - Chapter 2 - MDSE Principles
 
Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...
 
Enough talking - it's time to start doing
Enough talking - it's time to start doingEnough talking - it's time to start doing
Enough talking - it's time to start doing
 
Model driven software engineering in practice book - chapter 7 - Developing y...
Model driven software engineering in practice book - chapter 7 - Developing y...Model driven software engineering in practice book - chapter 7 - Developing y...
Model driven software engineering in practice book - chapter 7 - Developing y...
 
Introducing Eclipse MoDisco
Introducing Eclipse MoDiscoIntroducing Eclipse MoDisco
Introducing Eclipse MoDisco
 
HXR 2016: Free the Data Access & Integration -Aashima Gupta, Apigee
HXR 2016: Free the Data Access & Integration -Aashima Gupta, ApigeeHXR 2016: Free the Data Access & Integration -Aashima Gupta, Apigee
HXR 2016: Free the Data Access & Integration -Aashima Gupta, Apigee
 
Putting order to your API ecosystem
Putting order to your API ecosystemPutting order to your API ecosystem
Putting order to your API ecosystem
 
Performance and Extensibility with EMF
Performance and Extensibility with EMFPerformance and Extensibility with EMF
Performance and Extensibility with EMF
 
Are Your Microservices Naked and Afraid?
Are Your Microservices Naked and Afraid?  Are Your Microservices Naked and Afraid?
Are Your Microservices Naked and Afraid?
 

Similar to EMF-REST: Generation of RESTful APIs from Models

STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010
Shakir Majeed Khan
 
Development of forms editors based on Ecore metamodels
Development of forms editors based on Ecore metamodelsDevelopment of forms editors based on Ecore metamodels
Development of forms editors based on Ecore metamodels
Mario Cervera
 

Similar to EMF-REST: Generation of RESTful APIs from Models (20)

EclipseCon 2007: Effective Use of the Eclipse Modeling Framework
EclipseCon 2007: Effective Use of the Eclipse Modeling FrameworkEclipseCon 2007: Effective Use of the Eclipse Modeling Framework
EclipseCon 2007: Effective Use of the Eclipse Modeling Framework
 
React & Redux JS
React & Redux JS React & Redux JS
React & Redux JS
 
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling FrameworkEclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
 
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling FrameworkEclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
 
Node.js Express Framework
Node.js Express FrameworkNode.js Express Framework
Node.js Express Framework
 
ASP.NET MVC - In the Wild
ASP.NET MVC - In the WildASP.NET MVC - In the Wild
ASP.NET MVC - In the Wild
 
STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010
 
Intro to EmberJS
Intro to EmberJSIntro to EmberJS
Intro to EmberJS
 
Application Integration Using XML Web Services - Report
Application Integration Using XML Web Services - ReportApplication Integration Using XML Web Services - Report
Application Integration Using XML Web Services - Report
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOM
 
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
 
Development of forms editors based on Ecore metamodels
Development of forms editors based on Ecore metamodelsDevelopment of forms editors based on Ecore metamodels
Development of forms editors based on Ecore metamodels
 
EclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
EclipseCon 2008: Fundamentals of the Eclipse Modeling FrameworkEclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
EclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
 
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSEMODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
 
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...
 
Bn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot netBn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot net
 
BIMSERVER.ORG – AN OPEN SOURCE IFC MODEL SERVER, 2010
BIMSERVER.ORG – AN OPEN SOURCE IFC MODEL SERVER, 2010BIMSERVER.ORG – AN OPEN SOURCE IFC MODEL SERVER, 2010
BIMSERVER.ORG – AN OPEN SOURCE IFC MODEL SERVER, 2010
 
Integrating Performance Modeling in Industrial Automation through AutomationM...
Integrating Performance Modeling in Industrial Automation through AutomationM...Integrating Performance Modeling in Industrial Automation through AutomationM...
Integrating Performance Modeling in Industrial Automation through AutomationM...
 
Symfony2 and AngularJS
Symfony2 and AngularJSSymfony2 and AngularJS
Symfony2 and AngularJS
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
 

Recently uploaded

Recently uploaded (20)

LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
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
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
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...
 
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
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 

EMF-REST: Generation of RESTful APIs from Models

  • 1. Hamza Ed-douibi, Javier Luis Cánovas Izquierdo, Abel Gómez, Massimo Tisi, Jordi Cabot EMF-REST: Generation of RESTful APIs from Models 1 ACM SAC 2016 - Pisa, Italy. 07/04/2016
  • 2. EMF-REST: Generation of RESTful APIs from Models 2  The Model-driven engineering paradigm emphasizes the use of models to raise the level of abstraction and to (semi)automate the development of software. Abstraction Automation MDE Standar- dization  The Eclipse Modeling Framework (EMF) is the foundation for modeling and data integration at Eclipse. (Models are described using the Ecore language)
  • 3. EMF-REST: Generation of RESTful APIs from Models 3 Addressable resources (URI) Representation-oriented (JSON,XML) Statelessness Uniform and Constrained Interface Representational State Transfer (REST) is an architectural style that specifies constraints such as:
  • 6. EMF-REST approach  EMF-REST generates RESTful Web APIs out of EMF models.  The generated API provides a direct mapping to access data models following the REST principles : – Addressable resources (URI) – Representation-oriented (JSON,XML) – Statelessness – Uniform and Constrained Interface (HTTP verbs : GET, POST,…)  The generated application supports validation and security.  The generated RESTful Web API relies on well-known libraries and standards. 6
  • 7. EMF-REST features 7 REST API JSON Serialization XML Serialization Validation Security
  • 8. Running Example 8 IFML (Interaction Flow Modeling Language) model: A form from a movie manager
  • 9. Mapping EMF with REST EMF EMF-REST 9 Addressable resources 1. platform:/resource/project/AddMovie.xmi 2. platform:/resource/project/AddMovie.xmi#title 3. platform:/resource/project/AddMovie.xmi#//.../@viewComponentsParts.0 1. https://example.com/rest/IFMLModel/AddMovie 2. https://example.com/rest/IFMLModel/.../viewComponentsParts/title 3. https://example.com/rest/IFMLModel/.../viewComponentsParts?index=0
  • 10. Mapping EMF with REST XML JSON 10 Representation-Oriented <form> <name>AddMovieForm</name> <viewComponentParts> <simpleField> <uri>https://example.com/.../ viewComponentsParts/picture</uri> </simpleField> <simpleField> <uri>https://example.com/.../ viewComponentsParts/title</uri> </simpleField> ... </viewComponentParts> <viewElementEvents> <onSubmitEvent> <uri>https://example.com/.../ viewElementEvents/add</uri> </onSubmitEvent> </viewElementEvents> </form> { "form":{ "name":"addMovieForm", "viewComponentParts":{ "simpleField":[ { "uri":"https://.../ viewComponentsParts/picture" }, { "uri":"https://.../ viewComponentsParts/title" } ,…] }, "viewElementEvents":{ "onsubmitevent":{ "uri":"https://.../ viewelementevents/add" } } } }
  • 11. Mapping EMF with REST: Uniform and Constrained Interface & Statelessness EMF EMF-REST 11 PUT https :// example .com/rest/IFMLModel/AddMovie/ interactionFlowElements/AddMovieWindow/ viewElements /AddMovieForm {"form":{ name :"toto" } } addMovieFormObj . setName (" toto "); //addMovieFormObj is of type Form
  • 12. Extra features  Validation – Use of OCL annotations to enable validation each time the API is called  Security – Encryption: All the communications with the server are using HTTPS – Authentication: Only authenticated users are allowed to access the API – Authorization: Use of a Role-based mechanism to assign permissions for each operation. – Use of model annotations to support authentication and authorization 12
  • 13. Architecture of EMF-REST generated application 13 EMF JAX-RS EJB/CDI JAXB OCL JPA JavaScript API Browser REST Client Validation SecurityContent management Web ClientWeb Application
  • 15. Conclusion & future work  EMF-REST generates truly RESTful APIs for EMF models by mapping data models with REST principles.  EMF-REST complements the existing (Java-based) API generation facilities EMF already provides and extends them to the Web.  Future work: – Storage configuration – Configuration of the generated API – Definition of how model elements should be serialized. 15
  • 16. Thank you! 16 • Visit us at: http://som- research.uoc.edu/tools/emf-rest/ • Hamza Ed-douibi: hed-douibi@uoc.edu •Javier Cánovas: jcanovasi@uoc.edu •Jordi Cabot: jordi.cabot@icrea.cat