Web Architecture & Services (2) Representational State Transfer (REST)

Slides:



Advertisements
Similar presentations
Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Advertisements

Representational State Transfer (REST) Paul Townend 8 th February 2007.
Overview Environment for Internet database connectivity
REST - Representational State Transfer
REST Vs. SOAP.
REST Introduction 吴海生 博克软件(杭州)有限公司.
Building and using REST information services Rion Dooley.
Introduction to Web Services
REST (Representational State Transfer)
Reinventing using REST. Anything addressable by a URI is called a resource GET, PUT, POST, DELETE WebDAV (MOVE, LOCK)
CS 4720 RESTfulness CS 4720 – Web & Mobile Systems.
COM vs. CORBA.
Building RESTful Interfaces
Thoughts on Architecture for the Internet of Things Group Name: Working Group 2 - Architecture Source: Nicolas Damour, Sierra Wireless
Chapter 3: Programming Web Services Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
OCT1 Principles From Chapter One of “Distributed Systems Concepts and Design”
RESTful Publish Subscribe Xiang Su
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
CPS120: Introduction to Computer Science The World Wide Web Nell Dale John Lewis.
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
RESTful Organizing Systems
Wyatt Pearsall November  HyperText Transfer Protocol.
Prepared By : Monika Darji Web Services using REST & JAX-WS.
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
XML Web Services Architecture Siddharth Ruchandani CS 6362 – SW Architecture & Design Summer /11/05.
REST - Introduction Based on material from InfoQ.com (Stefan Tilkov) And slides from MindTouch.com (Steve Bjorg) 1.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
A Limited Definition of Web Services Paul Kopacz CIS* Service Oriented Architecture Instructor: Qusay H. Mahmoud, Ph.D. February.
SNOWTAM Trial: REST Interface. AIXM XML Developers' Seminar 2 Contents Digital-SNOWTAM Trial Introduction REST Introduction REST in the Digital-SNOWTAM.
1 Seminar on Service Oriented Architecture Principles of REST.
World Wide Web “WWW”, "Web" or "W3". World Wide Web “WWW”, "Web" or "W3"
API Crash Course CWU Startup Club. OUTLINE What is an API? Why are API’s useful? What is HTTP? JSON? XML? What is a RESTful API? How do we consume an.
2007cs Servers on the Web. The World-Wide Web 2007 cs CSS JS HTML Server Browser JS CSS HTML Transfer of resources using HTTP.
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
Advanced Web Technologies Lecture #4 By: Faraz Ahmed.
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
Introduction and Principles Web Server Scripting.
RESTful Web Services What is RESTful?
Web Services An Introduction Copyright © Curt Hill.
REST By: Vishwanath Vineet.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
Feeling RESTful? Well, first we’ll define a Web Service –A web page meant to be consumed by a computer via an autonomous program as opposed to a web browser.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins –
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Thoughts on Architecture for the Internet of Things
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
REST: Web Services Abel Sanchez.
REST- Representational State Transfer Enn Õunapuu
Representational State Transfer
Ashish Pandit IT Architect, Middleware & Integration Services
WEB API.
Lecture 1: Multi-tier Architecture Overview
$, $$, $$$ API testing Edition
Service-Oriented Computing: Semantics, Processes, Agents
Middleware, Services, etc.
REST APIs Maxwell Furman Department of MIS Fox School of Business
RESTful Web Services.
REST på Microsoft-stacken
WEB SERVICES From Chapter 19, Distributed Systems
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Web Architecture & Services (2) Representational State Transfer (REST)

Representational State Transfer (REST) is an architectural style for building distributed systems. The WWW is an example for such a system. REST-style applications can be built using a wide variety of technologies. REST's main principles are that of resource-oriented states and functionalities, the idea of a unique way of identifying resources, and the idea of how operations on these resources are defined in terms of a single protocol for interacting with resources. REST-oriented system design leads to systems which are open, scalable, extensible, and easy to understand. What is REST?

The Web is one distributed hypermedia system the main architectural components are URIs, HTTP, and HTML all other Web technologies are built on that foundation if they are not, they are very likely not well-designed Web technologies The Web is amazingly open, scalable, extensible, and easy to understand openness allows new technologies to be introduced scalability ensures that the system does not contain bottlenecks extensibility allows the Web to evolve without any redesign of existing parts simplicity makes sure that the system survives and evolves The Web as a System

Web Servers provide a service - Web pages can be retrieved (by a client) - Web pages can be uploaded to the server - clients can submit (HTTP POST) data to a resource - Web pages can be removed from the server - the original design of the Web was a writable Web For complex interactions, more operations are required - Web Distributed Authoring and Versioning (WebDAV) - defines additional HTTP methods - the basic HTTP methods may not always be sufficient - if required, additional methods on resources can be defined - if possible, these should be reusable for many resource types Web Servers

Web technologies must work in a RESTful way resources are identified by URIs and can be navigated resources have a state and can be accessed using HTTP state transitions are modeled as resource accesses If applications work different, they are not Web technologies they (or their data) may be accessible over the Web they may be integrated into Web browsers but they violate basic architectural principles of the Web Plug-ins other than single-presentation resources PDFs break a lot of browser navigation features Java applets are inaccessible from the outside Web Technologies

Resources are defined by URIs Resources are manipulated through their representations Messages are self-descriptive and stateless There can be multiple representations for a resource Application state is driven by resource manipulations REST principles

Resources Resources are defined by URIs resources can never be accessed or manipulated directly REST works with resource representations Resources are all the things we want to work with if you cannot name something, you cannot do anything with it a popular resource type on the Web are documents documents usually are a structured collection of information Documents are abstract concepts of descriptive resources they may be used in different contexts (e.g., formats) different applications may be interested in different representations the underlying resource is always the same

State is represented as part of the content being transferred server interruptions do not create problems for the client it is possible to switch between servers for different interactions clients can simply store the representation to save the state State transfer makes the system scalable data transfer is not state-specific (no stateful connection handling) state is transferred between client and server Loose coupling not only applies to API vs. document by transferring state, clients and server are decoupled state-wise this makes the handling of interactions much easier State

Establishing a Common Model Distributed systems must be based on a shared model traditional systems must agree on a common API SOA systems must agree on a number of messages (WSDL)WSDL REST systems structure agreement into three areas REST is built around the idea of simplifying agreement nouns are required to name the resources that can be talked about verbs are the operations that can be applied to named resources content types define which information representations are available

REST Triangle

Nouns are the names of resources in most designs, these names will be URIs URI design is a very important part of a REST-based system design Everything of interest should be named by supporting well-designed names, applications can talk about named things new operations and representations can be introduced Separating nouns from verbs and representations improves extensibility applications might still work with resources without being able to process them introducing new operations on the Web does not break the Web introducing new content types on the Web does not break the Web Nouns

Operations which can be applied to resources The core idea of REST is to use universal verbs only - universal verbs can be applied to all nouns For most applications, HTTP's basic methods are sufficient - GET: Fetching a resource (there must be no side-effects) - PUT: Transfers a resource to a server (overwriting if there already is one) - POST: Adds to an existing resource on the server - DELETE: Discards a resource (its name cannot be used anymore) Corresponding to the most popular basic database operations CRUD: Create, Read, Update, Delete Verbs

Representations should be machine-processable they don't have to, they may be opaque to applications in many cases, machine-processable representations are advantageous Resources are abstractions, REST passes representations around resources can have various representations (i.e., content types) clients can request content types they are interested in Adding or changing content types does not change the system architecture different clients and servers support different content types Content Negotiation allows content types to be negotiated dynamically Content Negotiation Content Types

Caching improves response time and reduces server load Less communication state enables easier load balancing between servers Less specialized software because the underlying technologies are simple Identification is done using standard mechanisms, no additional names necessary REST Claims

REST is not tied to a particular set of technologies URIs are the most common choice for nouns URIs HTTP methods are the most common choice for verbs HTTP XML is the most common choice for content types XML Choosing other technologies should have a very good reason building a REST system should make it open and accessible technology choices are as important as architectural choices REST Technologies

REST requires a lot of URI design instead of being generated as a side-effect, they are the core of the system Designing URIs and starting from them is a new way of thinking URIs are much more powerful than just being an address of a Web page URIs are names for concepts concepts are never transmitted, only their representation having to focus on concepts rather than representations is helpful URIs

HTTP is the most successful RESTful protocol - HTTP's author Roy Fielding coined the term REST in his Ph.D. thesis HTTP should be regarded as an application-level protocol - Web Service technologies use HTTP as a transport protocol - HTTP has much more to offer than a firewall-penetrating pipe Web infrastructure is built around proper HTTP usage - caching is built into HTTP and caches optimize the Web transparently - authentication can be done using HTTP's authentication methods - secure data transfer can be done using HTTP over SSL (HTTPS) HTTP

URI-identified resources are abstract concepts for machine-based processing, XML is a good representation for human-oriented interactions, HTML probably is a better choice Connections to other resources must be done by URI XML does not make built-in assumptions about identifiers but it does support URIs, for example with XInclude and XML Base RESTful applications are about navigating a Web of URI- identified resources XML

Better Services REST is an architectural style URI/HTTP/HTML/XML may be replaced the general principle of resource-based interaction remains valid RESTful system designs can create better systems a little bit more design effort in the beginning a lot less headaches later SOA often are not really RESTful SOA often focuses on operations REST focuses on resources RESTful design is a good starting point for OO implementations

Original Content: Copyright © 2006 Erik Wilde, UC Berkeley