Top Banner
RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1 , Frederico Durao 2 , Santiago Meliá 3 , Peter Dolog 2 , Oscar Díaz 1 1st International Symposium on Web Intelligent Systems & Services December 12th, 2010
27

RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

Mar 28, 2015

Download

Documents

Denzel Crossley
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Page 2: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

MODEL DRIVEN DEVELOPMENT

Page 3: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Model Driven Development

Page 4: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Page 5: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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.

Page 6: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Page 7: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Page 8: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

From Navigational Model to Architectural Model

client

server

Page 9: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

NEW ARQUITECTURAL STYLE: REST

Page 10: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

REST is becoming very popular

Page 11: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Platform Evolution: REST

Order PSMREST

Page 12: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Page 13: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Page 14: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

Problem Statement

Page 15: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Can RESTful services be generated?

Order PSMREST

Page 16: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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?

Page 17: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

The Architectural Model in Details

GETHEADPUTPOSTDELETEOPTIONS

Page 18: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Resources + URIs + OperationType + Parameters

Page 19: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

Contribution

Application Facade Component Model

Page 20: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Obtaining RESTful interfaces from PIM

Order PSMREST

Page 21: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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 …

Page 22: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

URIs are obtained from …

Page 23: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

+

Operation Types are obtained from …

Page 24: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

Representations: JSON By Default

Page 25: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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

1. Path

2. Link stereotypes

Parameters are obtained from …

Page 26: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

Conclusions

Page 27: RESTful, Resource-Oriented Architectures: a Model-Driven Approach Sandy Pérez 1, Frederico Durao 2, Santiago Meliá 3, Peter Dolog 2, Oscar Díaz 1 1st International.

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