RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2,...

Post on 28-Mar-2015

217 views 0 download

Tags:

Transcript of RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2,...

RESTful, Resource-Oriented Architectures: a Model-Driven Approach

Sandy Pérez1, Frederico Durao2, Santiago Meliá3, Peter Dolog2, Oscar Díaz1

1st International Symposium on Web Intelligent Systems & ServicesDecember 12th, 2010

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

MODEL DRIVEN DEVELOPMENT

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

Model Driven Development

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 4

Data-intensive Web Applications

Data-intensive Web applications are built around the so-called “Domain Model”

This Domain Model is then complemented with other models that capture additional perspectives of the applications:

• Navigational Model• Presentation Model• Architectural Model

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 5

Domain model

The Domain Model captures the main entities and relationships found in the application domain.

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

Navigational Model

It specifies the data to be presented as a view of the Domain Model, and the order in which this data is to be presented

6

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 7

Architectural Model

It is a component-based architectural style that represents a structural view of the application

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 8

From Navigational Model to Architectural Model

client

server

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

NEW ARQUITECTURAL STYLE: REST

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 10

REST is becoming very popular

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

Platform Evolution: REST

Order PSMREST

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

GET /users HTTP/1.1

12

RESTful, Resource-Oriented Architectures (ROAs) ROA is a specific set of guidelines of an implementation of the

REST-style architecture.

ROAs are based on four concepts:• Resources

• Their names (URIs). The URI is the name and address of a resource.

• Their representations. A resource is a source of representations.

• The links between them.

Client Serverfriends

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 13

RESTful Web Services

RESTful Web services are simple Web services implemented using HTTP and the principles of REST.

They expose standard HTTP objects (i.e. resources) that respond to one or more of the six standard HTTP methods: GET, HEAD, POST, PUT, DELETE, and OPTIONS.

Client Server

GET /users HTTP/1.1users

Problem Statement

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

Can RESTful services be generated?

Order PSMREST

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 16

From a RPC façade to a RESTful facade

client

server

GETHEADPUTPOSTDELETEOPTIONS

How?

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 17

The Architectural Model in Details

GETHEADPUTPOSTDELETEOPTIONS

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 18

Resources + URIs + OperationType + Parameters

Contribution

Application Facade Component Model

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

Obtaining RESTful interfaces from PIM

Order PSMREST

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

…any NavigationalClass with at least one outgoing traversal link or service link at the Navigational Model.

Resource are obtained from …

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 22

URIs are obtained from …

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

+

Operation Types are obtained from …

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 24

Representations: JSON By Default

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz

1. Path

2. Link stereotypes

Parameters are obtained from …

Conclusions

S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 27

Conclusions

Data-intensive Web Applications naturally match the REST architectural style

(Part of) the RESTful interface can be derived from the Domain & Navigation model

• Except:– the representation type: JSON by default– the operation type (delete, post): it should be annotated by

the designer