such implicit information after Dave logs in the fact that his user ID is 301

Such implicit information after dave logs in the fact

This preview shows page 94 - 95 out of 517 pages.

such implicit information: after Dave logs in, the fact that his user ID is 301 is present in every request, and his cart is identified explicitly by his user ID rather than implicitly based on the notion of a currently-logged-in user. Non-RESTful site URI RESTful site URI Login to site POST /login/dave POST /login/dave Welcome page GET /welcome GET /user/301/welcome Add item ID 427 to cart POST /add/427 POST /user/301/add/427 View cart GET / cart GET /user/301/cart Checkout POST /checkout POST /user/301/checkout Figure 2.13: Non-RESTful requests and routes are those that rely on the results of previous requests. In a Service-Oriented Architecture, a client of the RESTful site could immediately request to view the cart (line 6), but a client of the non-RESTful site would first have to perform lines 3–5 to set up the implicit information on which line 6 depends. Summary: Routes and RESTfulness A route consists of an HTTP method ( GET , POST , PUT , or DELETE ) and a URI, which may include some parameters. App frameworks such as Rails map routes to controller actions. An app designed in accordance with REST (REpresentational State Transfer) can be seen from the outside as a collection of entities on which specific operations can be performed, with each operation having a corresponding RESTful request that includes all the information necessary to complete the action. When routes and resources are RESTful, the same controller logic can usually serve user-facing pages via a Web browser or requests arriving from other services in a SOA. Although web browsers only support the GET and POST HTTP methods, framework logic can compensate so that the programmer can work under the assumption that all methods are available. ELABORATION: REST vs. SOAP vs. WS-* In the late 1990s, as interest in SOA increased, vendors and standards bodies created committees to develop standards for SOA interoperation. One approach resulted in a collection of elaborate protocols for W eb S ervices including WS-Discovery, WS- Description, and others, sometimes collectively called WS-* and jokingly called “WS-Deathstar” by David Heinemeier Hansson, the creator of Rails. The competing SOAP standard (Simple Object Access Protocol) was a bit simpler but still far more complex than REST. By and large, practicing developers perceived SOAP and WS-* as overdesigned committee-driven standards burdened by the archaic design stance of enterprise-based interoperation standards such as CORBA and DCOM, which preceded them. In contrast, although REST is dramatically simpler and is more of a philosophy than a standard, it appealed immediately to developers, so that is how the majority of SOA apps are built today. Self-Check 2.7.1. True or false: If an app has a RESTful API, it must be performing CRUD operations.
Image of page 94
Image of page 95

You've reached the end of your free preview.

Want to read all 517 pages?

  • Spring '19
  • Dr.Marcos

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors