University of Lugano (USI)
Faculty of Informatics
- Opened 2004
- 25 Professors
- 125+ PhD/Postdoc researchers
- Research: Software, Systems and Services Engineering
- Award-winning Innovative Teaching Curriculum
Architecture, Design and Web Information Systems Engineering
- BenchFlow - a benchmark for workflow engines
- Liquid Software Architecture
- ASQ - Interactive Scalable Lectures
- Parallel JavaScript/Multicore Node.JS
- SAW - Collaborative Architectural Decision Making
- NaturalMash - Web Service Composition with Natural Language
http://design.inf.usi.ch
Abstractions
Microservices
Interfaces
Conversations
Multiple interactions (message exchanges) between two or more participants to achieve a goal
G. Hohpe
What is REST?
RESTful Conversations
Examples
?
GET /booking/42?payment HTTP/1.1
HTTP/1.1 302
Link: </payment?booking=42>; rel="payment"
GET /payment?booking=42 HTTP/1.1
HTTP/1.1 200
Long Running Task
POST /slow HTTP/1.1
HTTP/1.1 202 Accepted
Location: /slow/42
...
GET /slow/42
HTTP/1.1 200
...
GET /slow/42
HTTP/1.1 303 See Other
Location: /result/42
GET /result/42
HTTP/1.1 200
Try-Confirm/Cancel (TCC)
Try to reserve multiple resources
POST /telephone HTTP/1.1
Host: api.swisscom.ch
HTTP/1.1 201 Created
Location: /telephone/0586664302
POST /bill HTTP/1.1
Host: api.post.ch
HTTP/1.1 201 Created
Location: /bill/42
If everything is successful, confirm the bookings
PUT /telephone/0586664302 HTTP/1.1
Host: api.swisscom.ch
Accept: application/tcc
HTTP/1.1 204 No Content
PUT /bill/42 HTTP/1.1
Host: api.post.ch
Accept: application/tcc
HTTP/1.1 204 No Content
RESTful Conversation
Link: </payment?booking=42>; rel="payment"
Services control the conversation by embedding links into representations/responses
Clients drive the conversation by deciding which link to follow
Services only reveal the immediate next steps
Clients need to understand the link relation semantics to choose the link to follow
How to model RESTful Conversations?
BPMN
Software Connectors
BPMN and Software Connectors
Real World Example
AirBnB Conversation
State (in)visibility
Where can you find the reservation in the model?
At the end, one Participant gets notified, the other just knows the outcome
Interaction abstraction
email notifications for state changes driven by HTTP POST (form submission) or timeouts
What if a participant wants to track the progress, check the status?
What if a participant wants to cancel the reservation?
Hypermedia
email notifications for state changes
include a hyperlink to continue the conversation with other form submissions (HTTP POST)
How is the link correlated with the process/task instance?
Modeling Challenges
Define resource lifecycle (creation, destruction, updates and allowed state transitions)
Represent how to embed hypermedia controls (links, forms) as part of messages/representations
BPMN 2 Choreography
RESTful Choreography
Modeling Challenges
Define resource lifecycle (creation, destruction, updates and allowed state transitions)
Represent how to embed hypermedia controls (links, forms) as part of messages/representations
Capture recurring conversation patterns
(Some) Conversation Patterns
- Redirection
- Long Running Requests
- Collection Navigation
- Collection Item Lifecycle
- Editable Resource
- Try-Confirm/Cancel
- Post Once Exactly
- Protected Resource
Redirection
Editable Resource
Long Running Request
RESTful conversations
- REST services engage in conversations, steered by hyperlinks embedded in resource representations
- How to capture the conversation flow, modeling resource lifecycles and hypermedia types? (BPMN?)
- We have started to collect recurring conversation patterns: let us know if you spot some in your RESTful API
References
- C. Pautasso, A. Ivanchikj, S. Schreier, "Modeling RESTful Conversations with extended BPMN Choreography diagrams", 9th European Conference on Software Architecture (ECSA 2015), Dubrovnik, Croatia, Springer, September, 2015.
- F. Haupt, F. Leymann, C. Pautasso: A conversation based approach for modeling REST APIs, 12th Working IEEE / IFIP Conference on Software Architecture (WICSA 2015), Montreal, CA, May 2015
- J. Bellido, R. Alarcon, C. Pautasso, Control flow patterns for decentralized RESTful service composition, ACM Transactions on the Web, 8(1):5, December 2013 doi:10.1145/2535911
- T. Erl, B. Carlyle, C. Pautasso, R. Balasubramanian, SOA with REST: Principles, Patterns & Constraints for Building Enterprise Solutions with REST, Prentice Hall, August 2012, ISBN 9780137012510
- C. Pautasso, RESTful Web Service Composition with JOpera, Proc. of the International Conference on Software Composition (SC 2009), Zurich, Switzerland, July 2009
- A. Gambi, C. Pautasso, RESTful Business Process Management in the Cloud, Proc. of the 5th ICSE International Workshop on Principles of Engineering Service-Oriented Systems (PESOS 2013), San Francisco, USA, May 2013
- C. Pautasso, BPMN for REST, In Proceedings of the 3rd International Workshop on BPMN (BPMN 2011), Lucerne, Switzerland, November 2011
- C. Pautasso, RESTful Web Service Composition with BPEL for REST, Data & Knowledge Engineering, Volume 68, Issue 9, September 2009, Pages 851-866, doi:10.1016/j.datak.2009.02.016.
Ack: Gregor Hohpe, Silvia Schreier, Ana Ivanchikj, Florian Haupt, Frank Leymann, Mathias Weske, Adriatik Nikaj, Sankalita Mandal, Guy Pardon
Use a spacebar or arrow keys to navigate