rest and resource oriented architecture - okcdg march 2008

Download REST and Resource Oriented Architecture - okcDG March 2008

If you can't read please download the document

Upload: ryan-hoegg

Post on 16-Jan-2017

223 views

Category:

Software


0 download

TRANSCRIPT

REST

and Resource Oriented Architecture

okcDGMarch 2008

Ryan HoeggValtech Technologies

REST, ROA, and Web Services

Architectural style of the WWW

One way to build RESTfulweb services

Not very well defined

REST:

ROA:

Web Services:

So what is Web Services?

...hem hem haw hem haw...

What they said

Here's some software.

They're great! Buy our tools!

W3C:

Wikipedia:

Apache:

Microsoft:

1. (W3C paraphrased) Programmatic interfaces made available for application to application communication on the World Wide Web2. (W3C quote) Web services provide a standard means of interoperating between different software applications, running on a variety of platforms and/or frameworks.3. (Wikipedia paraphrased) clients and servers that communicate using XML messages that follow the SOAP standard, optionally using WSDL to describe interfaces.4. xml.com quoting IBM: self-contained, self-describing, modular applications that can be published, located, and invoked across the Web.5. RestWiki: distributed computing using web standards wherein the data being exchanged is designed for machine consumption rather than human consumption.

So what is Web Services??

Software services deployed on the WWW intended for use by other software components

Big Web Services include SOAP, WSDL, WS-*

What is REST?

Architectural style for distributed hypermedia systems

Behind the architecture of the WWW

Described in Architectural Styles and the Design of Network-based Software Architectures by Roy T. Fielding

Software Architecture

A set of rules about the components, connectors, and data in a software system intended to induce some desired properties.

...A software architecture is an abstraction of the run-time elements of a software system during some phase of its operation.

--Roy T. Fielding

Architectural Style

a set of rules that an architecture should conform to-- from the RestWiki

...a coordinated set of architectural constraints that restricts the roles/features of architectural elements and the allowed relationships among those elements within any architecture that conforms to that style.

-- Roy T. Fielding

Architectural Constraints

Addressable Resources

Statelessness

Connectedness

Uniform Interface

Resource?

Any information or concept that can be named.

The key abstraction of information in REST

The intended conceptual target of a hypertext reference

-- Roy T. Fielding

Representation

The information about a resource that is transmitted across the network.

Any useful information about a resource's current state.

Addressability

A resource identifier should represent only one resource.

Statelessness

The server never stores any application state. Each request can be considered in isolation.

Connectedness

The server includes levers of state in the representations it sends to the client.

Guides the client in changing resource or application state.

Uniform Interface

Resources share interface characteristics.

For example: methods, identifiers, data types

What does it buy me?

Large surface area

Scalable and Reliable

Easy to use and Robust

Transparent and Reliable

Addressable =

Stateless =

Connected =

Uniform =

Addressable: Everything interesting about your service is immediately accessible from the outside

Stateless: Load balancing, retries, caching

Connected: Easy to figure out what it does and how to use it. Even when you change those things.

Uniform Interface: Easy to figure out again, and also allows intermediaries to understand each request at a deeper level. Reduces coupling between components.

REST provides a set of architectural constraints that, when applied as a whole, emphasizes scalability of component interactions, generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems. -- Fielding

Also, supports gradual and fragmented deployment of changes within an already deployed architecture.

Where REST came from

CERN ENQUIRE project

MOMSpider and libwww-perl

mailing list for NCSA httpd becomes the Apache HTTPD Project

REST guides the architecture of the WWW, and the WWW serves as a testbed for the ideas behind REST

1990-1992:

1993-1994:

1994-1995:

1995-now:

The World Wide Web began as a CERN project called ENQUIRE, initiated by Tim Berners-Lee and Robert Cailliau in 1990. Berners-Lee and Cailliau were jointly honored by the ACM in 1995 for their contributions to the development of the World-Wide Web.

REST on the Web

URI

HTTP

Hypermedia

URI

Uniform Resource Identifier

Provides addressability of resources

e.g. http://okcpro.net/Events/MeetingsEvents/tabid/60/Default.aspx

Filesystem example component

Hypermedia?

Hypertext is text with links and forms.

Hypermedia expands this to include other representations such as SVG.

HTTP

GET /Events/MeetingsEvents/tabid/60/Default.aspx HTTP/1.1Host: okcpro.net

HTTP/1.1 200 OKDate: Mon, 10 Mar 2008 05:10:43 GMT...Content-Type: text/html