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, ONEKIN Research Group Univ. of the Basque Country San Sebastián (Spain) 2 IWIS Group Aalborg University Aalborg (Denmark) 3 IWAD Group University of Alicante Alicante (Spain)
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 PSM REST
S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz GET /users HTTP/ 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 Server friends
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.1 users
Problem Statement
S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz Can RESTful services be generated? Order PSM REST
S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 16 From a RPC façade to a RESTful facade client server GET HEAD PUT POST DELETE OPTIONS How?
S. Pérez, F. Durao, S. Meliá, P. Dolog & O. Díaz 17 The Architectural Model in Details GET HEAD PUT POST DELETE OPTIONS
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 PSM REST
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