Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Web Services with Windows Azure (new)

You're reading from   Building Web Services with Windows Azure (new) Quickly develop scalable, REST-based applications or services and learn how to manage them using Microsoft Azure

Arrow left icon
Product type Paperback
Published in May 2015
Publisher
ISBN-13 9781784398378
Length 322 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface Introduction FREE CHAPTER 1. Getting Started with the ASP.NET Web API 2. Extending the ASP.NET Web API 3. API Management 4. Developing a Web API for Mobile Apps 5. Connecting Applications with Microsoft Azure Service Bus 6. Creating Hybrid Services 7. Data Services in the Cloud – an Overview of ADO.NET and Entity Framework 8. Data Services in the Cloud – Microsoft Azure Storage 9. Data Services in the Cloud – NoSQL in Microsoft Azure Index

The REST style of services

REST stands for Representational State Transfer and perhaps the most important thing to realize about REST is that it is an architecture style and not a standard (like SOAP). What do we mean by this?

An architectural style is an accumulation of a set of design elements and constraints that can be tailored to define communication and interaction for a system. The elements in an architecture style are abstracted to ignore the implementation and protocol syntax and focus more on the role of the component. Additionally, constraints are applied to define the communication and extensibility patterns for these elements.

The focus of the REST architectural style is to improve the performance, portability, simplicity, reliability, and scalability of the system. The REST architecture style assumes the system as a whole in its initial state. It then evolves the system by incrementally applying constraints; these constraints allow components to scale efficiently while still maintaining a uniform set of interfaces. It also reduces deployment and maintenance considerations by layering out these components. Note that REST itself is a composition of many other architecture styles. For example, REST utilizes a set of other network architecture styles such data styles, hierarchical styles, and mobile code styles system to define its core architectural constraints. For more information on network architecture styles, please visit http://www.ics.uci.edu/~fielding/pubs/dissertation/net_arch_styles.htm.

For a Web API to be RESTful, most or all of the following architectural constraints must be satisfied:

Constraint

Description

Client-server

This constraint enforces a separation of concern between the client and server components. The core of this constraint is to promote a distributed architecture where the client can issue requests to a server, and the server responds back with status and the actual response. It enables multiple clients to interact with the server and allows the server to evolve independently.

Stateless

The stateless constraint evolves from the client server but mandates that no session state be allowed on the server component. The client must send all information required to understand the request and should not assume any available state on the server. This pattern is the backbone for enabling scalable Web APIs in a cloud-based environment.

Cache

Cache constraint is applied on top of client-server and stateless constraints and allows the requests to be implicitly or explicitly categorized as cacheable and noncacheable. The idea is to introduce a cache intermediator component that can improve latency by caching responses and minimizing interactions over the network. The cache can be employed as a consumer cache or a service side cache.

Uniform interface

The uniform interface constraint is the most critical constraint of a REST architecture style and distinguishes REST from other network architecture styles. The constraint emphasizes a uniform interface or contract between components. REST provides the following set of interface constraints: identification of resources, manipulation of resources through representation, self-descriptive messages, and hypermedia as the engine of application state. A typical uniform interface may be a combination of HTTP methods, media types (JSON, XML), and the resource URI. These provide a consistent interface for consumers to perform the desired operation on the resource.

Layered system

A layered system enables the architecture to be composed of hierarchical layers. These layers expose components to achieve specific behavior or functionality and these components only interact with components within their layer. Having a layered approach promotes extensibility and loose coupling between components.

Code on demand

The code on demand constraint is an optional constraint, and the main idea is to allow clients to be independently updated based on the browser add-on or client scripts.

For a more detailed understanding of REST-based architecture, the one source of truth is Roy Thomas Fielding's dissertation, Architectural Styles and the Design of Network-based Software Architectures (http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm).

You have been reading a chapter from
Building Web Services with Windows Azure (new)
Published in: May 2015
Publisher:
ISBN-13: 9781784398378
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime