NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

EMF-REST: generation of RESTful APIs from models

Hamza Ed-Douibi, Javier Luis Cánovas Izquierdo, Abel Gómez, Massimo Tisi, Jordi Cabot · DOI

Introduction

In modern software engineering, RESTful services have become the standard for lightweight, distributed architectures. However, because REST is an architectural style rather than a rigid specification, developers often struggle to implement APIs that consistently adhere to its core principles, such as statelessness and uniform interfaces. This often results in fragile, hard-to-maintain architectures.

Simultaneously, Model-Driven Engineering (MDE) frameworks like the Eclipse Modeling Framework (EMF) excel at defining complex data structures, but these models frequently remain isolated within desktop environments. EMF-REST bridges this gap by providing a framework that automatically generates fully functional, secure, and validated RESTful APIs directly from EMF data models, eliminating the need for manual "plumbing" and secondary modeling languages.

The EMF-REST Framework

EMF-REST is an Eclipse plugin that automates the transition from an Ecore model to a Java-based Web application. The framework's core strength lies in its direct mapping strategy, where model structures are translated into HTTP principles without requiring additional developer intervention.

Direct Mapping and CRUD Operations

Instead of requiring a separate API definition, EMF-REST maps EMF concepts directly to RESTful resources. Model references are transformed into URIs, and standard CRUD (Create, Read, Update, Delete) operations are automatically assigned to their corresponding HTTP verbs.

Mapping of model operations to RESTful API endpoints.

Validation and Security

To ensure data integrity, the framework integrates the Object Constraint Language (OCL). Business rules defined within the model—such as cardinality constraints or complex multi-object logic—are automatically enforced at the API level. If a request violates these rules, the API returns standard HTTP error codes.

Security is handled through model annotations. By tagging elements with specific roles, the generator produces code utilizing standard Java EE security features (e.g., @RolesAllowed) and enforces HTTPS communication. The resulting stack includes JAX-RS for the interface, JAXB for serialization, and Enterprise Java Beans (EJB) for transactional logic.

Case Study: The Family Model

To demonstrate the framework's capabilities, the authors utilized a "Family" Ecore model. This model incorporates inheritance, complex relationships, and various validation constraints that test the robustness of the generated API.

The 'Family' Ecore model used to demonstrate complex relationships and validation constraints.

By applying EMF-REST to this model, the authors showed how abstract designs (like the relationship between parents and children) are instantly transformed into ready-to-deploy web services. For instance, the constraint that a child cannot have more than two parents is automatically managed by the OCL-driven validation layer.

Key Insights and Results

The primary insight of this research is that a well-structured data model already contains the necessary metadata to define a high-quality RESTful interface. EMF’s native ability to manage model instances aligns naturally with REST’s requirement for statelessness, as each API call can independently handle the model lifecycle.

The implementation of EMF-REST as an open-source tool yields several key outputs:

  1. Deployable Maven Project: A complete project structure ready for immediate build and deployment.
  2. Multi-format Resources: JAX-RS resources that expose the model via both JSON and XML.
  3. Developer Tooling: A generated JavaScript API and an administrative view for immediate service testing.

Limitations and Future Work

While EMF-REST significantly reduces development time, the authors identify areas for further refinement. Currently, the URI structure is fixed by the generator; future versions may include a configuration DSL to allow for custom URI designs. Additionally, to support "Big Models" that exceed server memory, the team is exploring integration with NoSQL-based persistence layers like Neo4EMF. Finally, more granular security controls are planned to allow for attribute-level permission logic.

Summary updated

BibTeX
@inproceedings{eddouibi2015emf,
  author = {Hamza Ed-Douibi and Javier Luis Cánovas Izquierdo and Abel Gómez and Massimo Tisi and Jordi Cabot},
  title = {{EMF-REST: generation of RESTful APIs from models}},
  booktitle = {SAC},
  year = {2015},
  doi = {10.1145/2851613.2851782},
}
Figure