CLICK HERE TO DOWNLOAD PPT ON RESTFUL WEBSERVICES
RESTFUL WEBSERVICES Presentation Transcript
1.RESTFUL WEBSERVICES
2.What is REST?
REpresentational State Transfer.
An architectural style, not a toolkit.
REST is a design pattern.
It is a certain approach to creating Web Services
3. Representation
? A web page is a representation of a resource.
? Resources are just concepts.
? URIs tell a client that there's a concept
Somewhere.
? Clients can then request a specific representation of the
concept from the representations the server makes
available.
4.State
? “State” means application/session state.
? Maintained as part of the content transferred
from client to server back to client.
? Thus any server can potentially continue transaction
from the point where it was left off.
? State is never left .
5.Transfer of state
? Connectors (client, server, cache, resolver, tunnel)
are unrelated to sessions.
? State is maintained by being transferred from
clients to servers and back to clients.
REpresentational State Transfer.
An architectural style, not a toolkit.
REST is a design pattern.
It is a certain approach to creating Web Services
3. Representation
? A web page is a representation of a resource.
? Resources are just concepts.
? URIs tell a client that there's a concept
Somewhere.
? Clients can then request a specific representation of the
concept from the representations the server makes
available.
4.State
? “State” means application/session state.
? Maintained as part of the content transferred
from client to server back to client.
? Thus any server can potentially continue transaction
from the point where it was left off.
? State is never left .
5.Transfer of state
? Connectors (client, server, cache, resolver, tunnel)
are unrelated to sessions.
? State is maintained by being transferred from
clients to servers and back to clients.
6.Example Airline Reservation Service
7. Suppose that an airline wants to create a telephone
reservation system for customers to call in and make
flight reservations.
The airline wants to ensure that its premier members
get immediate service, its frequent flyer members
get expedited service and all others get regular service.
There are two main approaches to implementing the
reservation service...
reservation system for customers to call in and make
flight reservations.
The airline wants to ensure that its premier members
get immediate service, its frequent flyer members
get expedited service and all others get regular service.
There are two main approaches to implementing the
reservation service...
8.Approach 1
The airline provides a single telephone number.
Upon entry into the system a customer encounters an automated message, "Press 1 if you are a premier member, press 2 if you are a frequent flyer, press 3 for all others."
The airline provides a single telephone number.
Upon entry into the system a customer encounters an automated message, "Press 1 if you are a premier member, press 2 if you are a frequent flyer, press 3 for all others."
9.Approach 2
The airline provides several telephone numbers - one number for premier members, a different number for frequent flyers, and still another for regular customers.
The airline provides several telephone numbers - one number for premier members, a different number for frequent flyers, and still another for regular customers.
10.Discussion
In Approach 1 the answering machine introduces an extra delay, which is particularly annoying to premier members. (Doesn't everyone hate those answering systems)
With Approach 2 there is no intermediate step. Premier members get instant pickup from a customer service representative. Others may have to wait for an operator.
In Approach 1 the answering machine introduces an extra delay, which is particularly annoying to premier members. (Doesn't everyone hate those answering systems)
With Approach 2 there is no intermediate step. Premier members get instant pickup from a customer service representative. Others may have to wait for an operator.
11.Web-Based Reservation Service
Suppose now the airline (kings-air.com) wants to provide a Web reservation service for customers to make flight reservations through the Web.
Just as with the telephone service, the airline wants to ensure that its premier members get immediate service, its frequent flyer members get expedited service, all others get regular service.
There are two main approaches to implementing the Web reservation service. The approaches are analogous to the telephone service...
Suppose now the airline (kings-air.com) wants to provide a Web reservation service for customers to make flight reservations through the Web.
Just as with the telephone service, the airline wants to ensure that its premier members get immediate service, its frequent flyer members get expedited service, all others get regular service.
There are two main approaches to implementing the Web reservation service. The approaches are analogous to the telephone service...
12.The airline provides a single URL. The Web service is responsible for examining incoming client requests to determine their priority and process them accordingly.
13.Approach 1 Disadvantages
There is currently no industry accepted practice (rules) for expressing priorities, so rules would need to be made. The clients must learn the rule, and the Web service application must be written to understand the rule.
This approach is based upon the incorrect assumption that a URL is "expensive" and that their use must be rationed.
The Web service is a central point of failure. It is a bottleneck. Load balancing is a challenge.
There is currently no industry accepted practice (rules) for expressing priorities, so rules would need to be made. The clients must learn the rule, and the Web service application must be written to understand the rule.
This approach is based upon the incorrect assumption that a URL is "expensive" and that their use must be rationed.
The Web service is a central point of failure. It is a bottleneck. Load balancing is a challenge.
14.The airline provides several URLs - one URL for premier members, a different URL for frequent flyers, and still another for regular customers.
15. Approach 2 Advantages
The different URLs are discoverable by search engines and UDDI registries.
It's easy to understand what each service does simply by examining the URL, i.e., it exploits the Principle of Least Surprise.
There is no need to introduce rules. Priorities are elevated to the level of a URL. "What you see is what you get."
It's easy to implement high priority - simply assign a fast machine at the premier member URL.
There is no bottleneck. There is no central point of failure.
Consistent with Axiom 0.
The different URLs are discoverable by search engines and UDDI registries.
It's easy to understand what each service does simply by examining the URL, i.e., it exploits the Principle of Least Surprise.
There is no need to introduce rules. Priorities are elevated to the level of a URL. "What you see is what you get."
It's easy to implement high priority - simply assign a fast machine at the premier member URL.
There is no bottleneck. There is no central point of failure.
Consistent with Axiom 0.
16.This isn't the REST Design Pattern
17.This is the REST Design Pattern
0 comments