Make web site - 352 CHAPTER 11 REST-BASED MODEL VIEW CONTROLLER
352 CHAPTER 11 REST-BASED MODEL VIEW CONTROLLER PATTERN details should seek a book on that topic. For the .NET developers, I recommend my book, Foundations of Object-Oriented Programming Using .NET 2.0 Patterns (Apress, 2005) as it goes into detail regarding the use of .NET generics. Defining the Abstracted REST-Based Model View Controller Pattern Finishing the controller implementation means applying the Extension pattern for two levels of abstraction. The first level is the general case of implementing the REST-Based Model View Controller pattern. The second level is the case of implementing a search engine based on the REST-Based Model View Controller pattern. This section focuses on the first level of abstraction. The controller manages the local clients. In the context of the REST-Based Model View Controller pattern, the controller fulfills the abstract role of executing the local clients, managing the local clients, managing the request, and managing the results that will be returned to the client. The controller exposes itself to the local client by using an interface called Parent that is defined as follows: public interface Parent { public void addResult( Result result); public Request getRequest(); public void addCommand( Command cmd); public Iterator getCommands(); public void processRequest( Request request); public void processRequest( String type, Request request); public String getTransactionIdentifier(); } The methods of Parentuse general types such as Result, Command, and Request. Result defines a result generated by a local client. Requestdefines the HTTP request parameters such as the query string. And the local clients implement Command. There are two variations of the method processRequest. The processRequest with a single parameter will execute a search on all local clients. The processRequest with two parameters has as a first parameter the identifier of the local client that will process the request and generate the results (for example, amazon). The Request and Result interfaces are defined as follows: public interface Result { } public interface Request { } The interfaces have no method implementations and therefore represent pure general types, as illustrated by the Extension pattern example. The local clients implement the Command interface, which is defined as follows: public interface Command { public void setRequest( Request request); public void assignParent( Parent parent); public String getIdentifier(); }
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.