REST in Practice by Parastatidis Savas Robinson Ian Webber Jim

REST in Practice by Parastatidis Savas Robinson Ian Webber Jim

Author:Parastatidis, Savas, Robinson, Ian, Webber, Jim [Jim Webber, Savas Parastatidis, and Ian Robinson]
Language: eng
Format: epub
Tags: COMPUTERS / Systems Architecture / General
ISBN: 9781449394943
Publisher: O'Reilly Media
Published: 2010-09-14T16:00:00+00:00


GetFeedOfRecentEvents and GetFeed are static functions, both of which accept a NameValueCollection parameter and return a command. In the case of GetFeedCommand, this command is initialized with a ResourceId based on an id value in the parameters collection.

The constructor for Routes associates these functions with UriTemplates by adding them to a UriTemplateTable object. When it receives a request, CreateCommand(…) matches the request URI with a template in this table. If it finds a match, it invokes the associated function, passing in any variables parsed out of the request URI. The command returned from this invocation becomes the return value for CreateCommand(…).

At startup, the notifications service is initialized with a repository, which is then passed to this command. With each request, the repository queries the underlying store and returns a representation object, which the notifications service then hands to the condition (If-None-Match) supplied in the request. This condition is responsible for creating a Response object.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.