outline
play

Outline What is ReST ? Constraints in ReST REST Architecture - PowerPoint PPT Presentation

Outline What is ReST ? Constraints in ReST REST Architecture Components Features of ReST applications Example of requests in REST & SOAP Complex REST request REST Server response Real REST examples REST Design


  1. Outline ● What is ReST ? ● Constraints in ReST ● REST Architecture Components ● Features of ReST applications ● Example of requests in REST & SOAP ● Complex REST request ● REST Server response ● Real REST examples ● REST Design Guidelines ● Documentation ● Additional Reference

  2. History ● ReST was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation. Fielding is one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification versions 1.0 and 1.1. ● The REST architectural style was developed by W3C Technical Architecture Group in parallel with HTTP/1.1, based on the existing design of HTTP/1.0. The World Wide Web represents the largest implementation of a system conforming to the REST architectural style.

  3. What is ReST ? ● ReST stands for RE presentational S tate T ransfer. ● ReST is an architecture style for distributed systems. ● ReST is a hybrid style derived from several network based architecture styles combined with some additional constraints. ● ReST is not a protocol or standard. ● It uses simple HTTP to make calls between machines than complex architectures like SOAP. ● It consist of Client and Servers where Client intitiates request and Server responds to it using representation of resources .

  4. Understanding Architectural Approach ● When processing an architecture style, we can : ● Building system from scratch, with necessary elements, for an intended purpose. ● Building system by configuring system needs, incrementally applying constraints and understand system behaviour which reflects the properties of modern Web. ● ReST was developed using the latter approach.

  5. Constraints followed in REST design These constraints are applied on hybrid REST design sequentially: ● Client-Server. ● Stateless. ● Cacheable. ● Uniform Interface. ● Layered System. ● Code on Demand. ● The only optional constraint of REST architecture is code on demand. ● Conforming to the REST constraints is generally referred to as being " RESTful ". If a service violates any of the required constraints, it cannot strictly be considered RESTful Web Service.

  6. Client-Server Architecture Seperated system of concerns. ● It improves portability of the User Interface across multiple platforms. ● It enhances scalability of Server component. ● Servers and clients may also be developed independently, as long as ● the interface between them is not altered.

  7. Stateless Client-Server interaction must be stateless in nature. Server contains no ● client state. Any session state is held on the client. Each request must contain necessary information to be processed at server. ● It increases Reliability due to recovery from partial failures. ● It improves Scalability as server doesn't need to store the state of each ● request. Visibility enhances as intermediaries don't analyse request's record. ● Server has minimal control over the application behaviour. ●

  8. Cache Server responses (representations) may be cacheable or non-cacheable. ● Cacheable – Client cache can use response data. ● Non-Cacheable – Client cache has no privilege to use response data. ● Responses must therefore, implicitly or explicitly, define themselves as ● cacheable, or not. Well-managed caching partially or completely eliminates some client–server ● interactions improving scalability and performance. It may decrease reliability in case stale data within cache persists. ●

  9. Uniform Interface Defines the standards followed between client and server. ● ReST's basic operation – HTTP Verbs (GET, PUT, POST, DELETE), URI ● (Resource name), HTTP Response (Status, Body). The information being transferred has to follow standard rather than specific ● application needs. Multiple architectural constraints are needed to obtain the uniform interface. ●

  10. Principles of Uniform Interface Identification of resources : Individual resources are identified in ● requests. The resources are separate from the representations that are returned to the client. Manipulation of resources through these representations : When ● a client holds a representation of a resource, including any metadata attached, it has enough information to modify or delete the resource on the server, provided it has permission to do so. Self-descriptive messages : Each message includes enough ● information to describe how to process the message. Hypermedia as the engine of application state (HATEOAS) : ● Clients make state transitions only through actions that are dynamically identified e.g. Hyperlinks.

  11. Layered System Contraints applied on components as each component cannot see beyond ● the immediate layer. Layered system constraints allow intermediaries like: proxies , gateways , ● and firewall to be introduced at various points in the communication without changing the interfaces between components. Intermediary provide shared cache, security thus improving scalability. ● It may increase latency reducing user-perceived performance. ●

  12. Code on Demand Server can temporarily extend client functionality by allowing them to ● download and execute code in form of scripts/applets. Transfer logic to client. ●

  13. Style Derivation Summary ReST consists of a set of architectural constraints where each ● constraint has it's own feature. Their property is observed by their role in common architectural styles. ●

  14. REST Architectural Elements ReST focus on components, constraints, nature and state of the ● architecture's data elements. The format of the representation remains hidden through a generic interface. ● Use representation of resource for communication among elements. ● ELEMENTS : ● Resource can be any object, a collection of resources or refers to an ● intended conceptual target or reference. Semantics distinguishes one resource from another. ● Resource Identifier is used to identify the particular resource involved in an ● interaction between components, through URN or URL. Representation captures the current or intended state of a resource and ● transferring that representation between components. It may be a HTML document or an image. ●

  15. Representation metadata and Resource metadata provides additional ● information like media type, source link etc. Control data also defines the purpose of a message between components. ● It can be used to manipulate cache behaviour. M edia type defines the data format of a representation. The design of a ● media type can directly impact the user-perceived performance of a distributed hypermedia system CONNECTORS : ● Connector types are used to encapsulate the activities of accessing ● resources and transferring resource representations. A Client initiates communication by making a request e.g libwww. ● A Server listens for connections and responds to requests e.g Apache API. ● Cache connector may be used by a client or server to avoid repetition of ● network communication e.g browser cache.

  16. A Resolver translates resource identifiers into the network address ● information e.g. DNS look library. A Tunnel simply relays communication across a connection boundary e.g. ● SOCKS. COMPONENTS : ● A User agent uses a client connector to initiate a request and becomes the ● ultimate recipient of the response e.g. Web Browser. An Origin server uses a server connector to govern the namespace for a ● requested resource e.g IIS. A Proxy component is an intermediary selected by a client to provide ● interface encapsulation of other services, data translation, performance enhancement, or security protection e.g Gauntlet. A Gateway (a.k.a., reverse proxy) component is an intermediary imposed ● origin server to provide an interface encapsulation of other services, for data translation, performance enhancement, or security enforcement e.g Squid.

  17. REST Architectural Views Process View : It defines interaction relationship among components by ● revealing the path of data as it flows through the system. Connector View : A connector view of an architecture concentrates on the ● mechanics of the communication between components. Connectors examine the resource identifier in order to select an appropriate ● communication mechanism for each request. Data View : A data view of an architecture reveals the application state as ● information flows through the components. A steady state has no outstanding request. It determines the user perceived ● performance.

  18. Experience and Evaluation ● REST Applied to URI - ● Uniform Resource Identifiers (URI) are both the simplest element of the Web architecture and the most important. ● Redefinition of Resource - Identifier shouldn't change as Web uses embedded identifiers rather than link servers. ● Manipulating Shadows - Representations of identified resource are manipulated than resource itself. ● Remote Authoring – Mechanism of forward or manipulate representations. ● Binding semantics – Semantics are a by-product of act of assigning resource identifier.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend