REST REPRESENTATIONAL STATE TRANSFER Scott Ainsworth & Louis Nguyen (Group 1) Old Dominion University, CS 791: Web Syndication Formats, January 29, 2008.

Slides:



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

Overview Environment for Internet database connectivity
REST - Representational State Transfer
REST Vs. SOAP.
REST Introduction 吴海生 博克软件(杭州)有限公司.
Introduction to Web Services
31242/32549 Advanced Internet Programming Advanced Java Programming
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
General introduction to Web services and an implementation example
Building RESTful Interfaces
SOAP.
Web Services Seminar: Service Description Languages
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
Chapter 3: Programming Web Services Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Definitions, Definitions, Definitions Lead to Understanding.
Controling instrument in the RESTful way
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Services Michael Smith Alex Feldman. What is a Web Service? A Web service is a message-oriented software system designed to support inter-operable.
Introduction SOAP History Technical Architecture SOAP in Industry Summary References.
Chapter 4: Core Web Technologies
Web Architecture & Services (2) Representational State Transfer (REST)
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
REST vs SOAP for Web Services Applications and Services in Internet Benjamin Hilaire – 81747L
Wyatt Pearsall November  HyperText Transfer Protocol.
Prepared By : Monika Darji Web Services using REST & JAX-WS.
Web Services XML-RPC, SOAP, REST Advanced Web-based Systems | Misbhauddin.
Web HTTP Hypertext Transfer Protocol. Web Terminology ◘Message: The basic unit of HTTP communication, consisting of structured sequence of octets matching.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Web Services (SOAP, WSDL, UDDI) SNU OOPSLA Lab. October 2005.
1 Welcome to CSC 301 Web Programming Charles Frank.
REST - Introduction Based on material from InfoQ.com (Stefan Tilkov) And slides from MindTouch.com (Steve Bjorg) 1.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
Copyright © cs-tutorial.com. Overview Introduction Architecture Implementation Evaluation.
A Limited Definition of Web Services Paul Kopacz CIS* Service Oriented Architecture Instructor: Qusay H. Mahmoud, Ph.D. February.
1 Seminar on Service Oriented Architecture Principles of REST.
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Web Architecture update for WSAWG/WSDL TAG published Principles of the Web Contents: –Identifiers Most of the work –Formats Not much –Protocols Summary.
2007cs Servers on the Web. The World-Wide Web 2007 cs CSS JS HTML Server Browser JS CSS HTML Transfer of resources using HTTP.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
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.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
RESTful Web Services What is RESTful?
Web Server Design Week 15 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/21/10.
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.
Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins –
Using Retrofit framework in implementation of Android REST client David Ante Macan*, Zlatko Stapić, Milan Pavlović* University of Zagreb Faculty of Organization.
The Client-Server Model
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- Representational State Transfer Enn Õunapuu
Representational State Transfer
Ashish Pandit IT Architect, Middleware & Integration Services
WEB API.
$, $$, $$$ API testing Edition
Web Server Design Week 16 Old Dominion University
Distributed Systems through Web Services
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
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:

REST REPRESENTATIONAL STATE TRANSFER Scott Ainsworth & Louis Nguyen (Group 1) Old Dominion University, CS 791: Web Syndication Formats, January 29, 2008

Presentation Overview  Motivation Behind REST  What is REST?  A Simple Example  The Web: a RESTful design  REST in more depth  REST Characteristics  Why REST?  REST vs. Web Services  REST is a Syndication Enabler 2

Motivation Behind REST  Roy Fielding instrumental in Web architecture  Went back for Ph.D.  Called it REST  Formally define the Web architecture 3

What Is REST?  A Simple, Concrete Example  Suppose we have a Web bulletin board  Suppose we need to view, update, and delete messages  Suppose we follow common procedural programming practices 4

What Is REST?  What message actions are required?  Create message  View message  View message for update  Delete message 5

What Is REST?  How do these actions map to HTTP and Web pages?  Note the dependence on GET. Why is this? 6 ActionHTTP MethodURL Create MessagePOSThttp://bbs/msg.php?m=create View MessageGEThttp://bbs/msg.php?m=view&id=12 Update MessagePOSThttp://bbs/msg.php?m=update&Id=12 Delete MessageGEThttp://bbs/msg.php?m=delete&id=12

What Is REST?  In addition to GET and PUT, HTTP protocol also includes:  PUT: create or replace an object  DELETE: delete an object 7

What Is REST?  How do the message actions map in REST? 8 ActionHTTP MethodURL Create MessagePOSThttp://bbs/message/new View MessageGEThttp://bbs/message/12 Update MessagePUThttp://bbs/message/12 Delete MessageDELETEhttp://bbs/message/12

What Is REST?  HTTP methods POST, GET, PUT, and DELETE are often compared with Create, Read, Update, and Delete (CRUD) operations associated with database functions: HTTPCRUD POSTCreate, Update GETRead PUTCreate, Update DELETEDelete HTTP methods do not always correspond directly with a single database operation. 9

World Wide Web: A RESTfull Design  The Web is example of RESTfull design that conforms to REST principles.  The Web consist of HTTP, content types (HTML, etc), and DNS.  HTML includes JavaScripts and applets to support code on demand (COD), which allows downloading and executing of code locally. COD provides improved extensibility and configurability, and better access to resources 10

World Wide Web: A RESTfull Design  HTTP is a communications protocol used as a transport to request and retrieve information on the Web  Uniform Interface: URIs, methods, status codes, headers, and content types  Safe Methods: GET, HEAD, OPTIONS, and TRACE Retrievals should not change the state of the server, ie. No side effects GET with side effects: useful for delete/insert message from a database (GET /edit.cgi?action=new)  Unsafe Methods: POST, PUT, DELETE 11

World Wide Web: A RESTfull Design  HTTP based on client-server principle: separation of web server and browser  When RESTful, HTTP is stateless  Client request, and every thing needed to complete the request, can be processed by the any server without knowing previous request  Stateless transaction example Buyer: Do you have a 1966 Ford Mustang for sale in Norfolk, VA? Ebay Server1: Yes, there’s one in near ODU and one in Ocean View area. Which one are you interested in? Buyer: I’m interested in buying a 1966 Ford Mustang near ODU in Norfolk, VA. Is it still for sale? Ebay Server2: Yes, here you go: ebay.com/odu_mustang 12

REST vs. RCP Approach  Remote Procedure Call (RPC) application exposed one or more resources  Provides unique set method invocation  Resources are hidden and RCP applications must have knowledge of the resources in order to locate and communicate with it  REST is more object oriented  Resources are highly visible and provided by URL  Client can interact with resources uniformly and navigate/transverse between URL w/o much knowledge of the resources 13

Example of RPC Application  RPC Operations getUser()addUser()removeUser()updateUser() getLocation()addLocation()removeLocation() updateLocation()listUsers()listLocations() findLocation()findUser()  RPC Client Code exampleAppObject = new ExampleApp('example.com:1234') exampleAppObject.removeUser('001') 14

Example of REST Application  REST Define Resources (1 for each user)  REST Client Code userResource = new Resource(' userResource.delete() userResource.findLocationForm() 15

REST vs. Web Services (RPC) Web ServicesREST ProtocolsSOAP (Simple Object Access Protocol) over HTTP. HTTP Request Mechanism XML over HTTP, usually POSTHTTP Actions (verbs)Many different actions, which are hidden within the request body. Standard HTTP methods (GET, PUT, POST, DELETE) SecurityAdditional SOAP-specific security layer. Web server security Web ServerHTTP and Web server are simple conduits with much of their power and capability are bypassed HTTP and Web server exploited to fullest extent 16

REST in More Depth  Architecture and Architectural Style  REST Characteristics  Elements  Configurations  Constraints, Principles, Guidelines 17

REST is about Architecture  Software architecture  An abstraction of the elements, configurations, constraints, principles, and guidelines that govern a system’s design and evolution.  Software architectural style  A set of constraints that restrict a software architecture. 18

First Definition of REST A software architectural style for networked application architectures. 19

REST Architectural Characteristics  Elements  Components: Perform computation. Take data as input and produce data as output. Examples: Web Servers, Gateways, Proxies, Applications, DBMSes, Web Browsers.  Connectors define interactions between components and encapsulate the details of transferring resource representations. Examples: HTTP and DNS libraries, browser caches, standard protocols.  Data File contents, HTML, XML, etc. Examples: User row in database, User data in XML. 20

REST Architectural Characteristics  Configurations  Relationships define and constrain the relationships between components, connectors, and data at run time.  Examples: “Connections must use HTTPS” “Users must be authenticated using PKI” 21

REST Operational Characteristics  Constraints, Principles, and Guidelines  Client-Server: separate presentation from data storage.  Stateless: all communication between the client and server must contain everything required to complete the request.  Cache: all data must be marked cacheable or non-cacheable improving network efficiency by allowing client to reuse response data. 22

REST Operational Characteristics  Constraints, Principles, and Guidelines  Uniform Interface: interfaces between components are uniform. Generally URIs, HTTP, and XML.  Layered System: provides loose coupling and scalability (through tiers and load balancing).  Code-On-Demand: allows downloading and executing code locally to access components: Javascript, java applets, Active-X. 23

Full Definition of REST A software architectural style based on the de facto World Wide Web architecture for networked client- server application architectures that requires stateless connections, cachable data, scalable implementations, uniform interfaces, client code-on-demand. 24

Why REST?  Separates representation and identification from process.  Leverages Web server capabilities, reducing application complexity and code.  Security  Logging  Scalability  Simple, common set of actions/methods  Matches the “natural” architecture of the Web.  Much less complicated infrastructure than RPC- based mechanism. 25

REST and Web Syndication  REST is about resources  Syndication is about resources  Simple relationship 26

Amazon S3  Amazon S3 is a Simple network Storage Service.  Provides cheap storage with read/write and pub/private access for the internet apps  Support REST and SOAP APIs  REST API is quickly understood in 7-page tutorial  SOAP API WSDL is 7 pages of XML with no explanations at all! 27

Amazon S3  S3 Core Concepts  Authorization: uses AWS key and private key  Objects: data files placed in buckets  Buckets: unique namespace for referencing your objects  Keys: unique identifier for an object Ex: cs791 is a bucket and REST/doc1.ppt is the key Getting Started Guide: WSDL: Using the REST API:

Summary  REST is an architectural style that  Focuses on resources  Minimizes verbs  Leverages existing Web server capabilities  REST encourages  Loose coupling Separation of representation and process Separation of security and logging from application  Maximum exploitation of Web servers and HTTP 29

Questions and Discussion  You are designing a system than manages widgets. Construct RESTfull URLs for  Retrieving a widget,  Adding a widget,  Updating a widget,  Deleting a widget, and  Retrieving lists of widgets. Use “widgetmage” for the domain. 30

Questions and Discussion  How does the layered system characteristic enable scalability?  How does it enable expansion? 31

Questions and Discussion  Which operational characteristics also enable scalability and expansion? How? 32

Questions and Discussion  Why does RPC/SOAP require its own security layer? 33

Questions and Discussion  Under what circumstances would SOAP-based Web Services (RPC) be a better choice than REST? 34

Questions and Discussion  What are the advantages of statelessness? 35

References  Fielding, Roy Thomas. “Architectural Styles and the Design of Network-based Software Architectures.” Diss. University of California, Irvine:  Software Engineering Institute. “Published Software Architecture Definitions.” 23 January Carnegie Mellon University.  “Resources as Objects.” RESTwiki. 11 May January bin/wiki.pl?ResourcesAsObjects. bin/wiki.pl?ResourcesAsObjects  “REST In Plain English.” RESTwiki. 20 September January  “The REST Triangle.” RESTwiki. 17 November January  “What is REST?” RESTwiki. 11 May January bin/wiki.pl?WhatIsRest. bin/wiki.pl?WhatIsRest  Fielding, R. T. and R.N. Taylor. “Principled Design of the Modern Web Architecture.” Architecture of the World Wide Web:  Amazon.com. “Amazon S3 Getting Started Guide.” 29 January

Extras 37

REST Operational Characteristics 38

REST Operational Characteristics 39

REST Operational Characteristics 40

REST Operational Characteristics 41