CORDOVA TRAINING
SESSION: 8 – REST API’S
INTRODUCTION
 REST stands for REpresentational State Transfer. REST is the software architectural
style of WWW.
 The advantages of using REST are:
 Performance
 Scalability
 Simplicity
 Visibility
 Portability
 Reliability
INTRODUCTION
 RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with
the same HTTP verbs like GET, POST, PUT, DELETE etc.
 REST is not a standard but an architectural style.
 Most of the RESTful implementations make use of common standards such as HTTP,
URI, JSON, and XML.
ARCHITECTURAL CONSTRAINTS
 REST has the following architectural properties:
 Client–Server
 Stateless
 Cacheable
 Layered
 Uniform interface
CLIENT - SERVER
 The client–server model of computing is a distributed application structure that partitions
tasks or workloads between the providers of a resource or service, called servers, and
service requesters, called clients.
 A client requests a server's content or service function.
 A server host runs one or more server programs which share their resources with clients.
CLIENT - SERVER
STATELESS PROTOCOL
 A stateless protocol is a communications protocol that treats each request as an
independent transaction that is unrelated to any previous request.
 Each communication consists of independent pairs of request and response.
 A stateless protocol does not require the server to retain session information or status
about each communications partner for the duration of multiple requests.
 The stateless design simplifies the server design because there is no need to
dynamically allocate storage to deal with conversations in progress.
STATELESS PROTOCOL
 If a client session dies in mid-transaction, no part of the system needs to be responsible
for cleaning up the present state of the server.
 A disadvantage of statelessness is that it may be necessary to include additional
information in every request, and this extra information will need to be interpreted by the
server.
 Eg: Authorization headers
WEB CACHE
 A web cache is an information technology for the temporary storage (caching) of web
documents, such as HTML pages and images, to reduce bandwidth usage, server load,
and perceived lag.
 A web cache system stores copies of documents passing through it; subsequent
requests may be satisfied from the cache if certain conditions are met.
LAYERED SYSTEM
 A layered system is a system in which components are grouped/layered, in a hierarchical
arrangement, such that lower layers provide functions and services that support the
functions and services of higher layers.
UNIFORM INTERFACE
 The uniform interface constraint is fundamental to the design of any REST service.
 The uniform interface simplifies and decouples the architecture, which enables each part
to evolve independently.
 Individual resources are identified in requests, for example using URIs in web-based
REST systems.
 The resources themselves are conceptually separate from the representations that are
returned to the client.
UNIFORM INTERFACE
 For example, the server may send data from its database as HTML, XML or JSON, none
of which are the server's internal representation.
SEMATIC URL
 Semantic URLs, also sometimes referred to as clean URLs, RESTful URLs, user-friendly
URLs, or search engine-friendly URLs, are Uniform Resource Locators (URLs) intended
to improve the usability and accessibility of a website or web service.
 Such URL schemes tend to reflect the conceptual structure of a collection of information
and decouple the user interface from a server's internal representation of information.
SEMATIC URL
 Semantic URLs also do not contain implementation details of the underlying web
application.
 This carries the benefit of reducing the difficulty of changing the implementation of the
resource at a later date.
SEMATIC URL
THANK YOU

Cordova training - Day 8 - REST API's

  • 1.
  • 2.
    INTRODUCTION  REST standsfor REpresentational State Transfer. REST is the software architectural style of WWW.  The advantages of using REST are:  Performance  Scalability  Simplicity  Visibility  Portability  Reliability
  • 3.
    INTRODUCTION  RESTful systemstypically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs like GET, POST, PUT, DELETE etc.  REST is not a standard but an architectural style.  Most of the RESTful implementations make use of common standards such as HTTP, URI, JSON, and XML.
  • 4.
    ARCHITECTURAL CONSTRAINTS  RESThas the following architectural properties:  Client–Server  Stateless  Cacheable  Layered  Uniform interface
  • 5.
    CLIENT - SERVER The client–server model of computing is a distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients.  A client requests a server's content or service function.  A server host runs one or more server programs which share their resources with clients.
  • 6.
  • 7.
    STATELESS PROTOCOL  Astateless protocol is a communications protocol that treats each request as an independent transaction that is unrelated to any previous request.  Each communication consists of independent pairs of request and response.  A stateless protocol does not require the server to retain session information or status about each communications partner for the duration of multiple requests.  The stateless design simplifies the server design because there is no need to dynamically allocate storage to deal with conversations in progress.
  • 8.
    STATELESS PROTOCOL  Ifa client session dies in mid-transaction, no part of the system needs to be responsible for cleaning up the present state of the server.  A disadvantage of statelessness is that it may be necessary to include additional information in every request, and this extra information will need to be interpreted by the server.  Eg: Authorization headers
  • 9.
    WEB CACHE  Aweb cache is an information technology for the temporary storage (caching) of web documents, such as HTML pages and images, to reduce bandwidth usage, server load, and perceived lag.  A web cache system stores copies of documents passing through it; subsequent requests may be satisfied from the cache if certain conditions are met.
  • 10.
    LAYERED SYSTEM  Alayered system is a system in which components are grouped/layered, in a hierarchical arrangement, such that lower layers provide functions and services that support the functions and services of higher layers.
  • 11.
    UNIFORM INTERFACE  Theuniform interface constraint is fundamental to the design of any REST service.  The uniform interface simplifies and decouples the architecture, which enables each part to evolve independently.  Individual resources are identified in requests, for example using URIs in web-based REST systems.  The resources themselves are conceptually separate from the representations that are returned to the client.
  • 12.
    UNIFORM INTERFACE  Forexample, the server may send data from its database as HTML, XML or JSON, none of which are the server's internal representation.
  • 13.
    SEMATIC URL  SemanticURLs, also sometimes referred to as clean URLs, RESTful URLs, user-friendly URLs, or search engine-friendly URLs, are Uniform Resource Locators (URLs) intended to improve the usability and accessibility of a website or web service.  Such URL schemes tend to reflect the conceptual structure of a collection of information and decouple the user interface from a server's internal representation of information.
  • 14.
    SEMATIC URL  SemanticURLs also do not contain implementation details of the underlying web application.  This carries the benefit of reducing the difficulty of changing the implementation of the resource at a later date.
  • 15.
  • 16.