EMF-REST allows generating RESTful APIs from EMF models by:
1) Mapping EMF resources to addressable REST resources with uniform interfaces.
2) Serializing EMF models as JSON or XML for REST representations.
3) Supporting extra REST features like validation, security, and statelessness.
The generated REST APIs enable accessing and modifying EMF models through a RESTful interface from web clients. EMF-REST aims to complement EMF's Java API generation with web accessibility.
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
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
2. EMF-REST: Generation of RESTful APIs
from Models
2
The MDE 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
3. EMF-REST: Generation of RESTful APIs
from Models
The Eclipse Modeling Framework (EMF)
EMF is the foundation for modeling and data
integration at Eclipse.
EMF allows creating models (by using the
Ecore language) and their instances.
EMF can generate efficient, correct, and easily
customizable java implementation code
Is surrounded by a huge ecosystem of tools
and frameworks (ATL, Accelio, Sirius,…)
3
4. EMF-REST: Generation of RESTful APIs
from Models
4
Addressable resources
Representation-oriented
Statelessness
Uniform and Constrained Interface
Representational State Transfer (REST) is an architectural style
that specifies constraints such as:
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. Conculsion & future work
EMF-REST generates truly RESTful APIs for EMF
models.
EMF-REST complements the existing (Java-based) API
generation facilities EMF already provides and
extends them to the Web.
Future work:
– Storage configuration (currently only file-based in
supported)
– 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:
jcanovas@uoc.edu
•Jordi Cabot:
jordi.cabot@icrea.cat