Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Page-Controller pattern exactly?

Is the Page-Controller pattern (the refinement of the MVC pattern as described in the Enterprise Solution Patterns using Microsoft .NET) basically the pattern of simple URI page requests (i.e. URI + form submission + query string); ASP's basically? Or is it something more complex.

Anyone?

http://msdn.microsoft.com/en-us/library/ff647095.aspx

like image 808
Jordan Avatar asked Nov 28 '10 17:11

Jordan


People also ask

What is a page controller?

An object that handles a request for a specific page or action on a Web site.

What is a controller design patterns?

The front controller design pattern is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler. This handler can do the authentication/ authorization/ logging or tracking of request and then pass the requests to corresponding handlers.

What is front controller pattern in Spring MVC?

The front controller design pattern means that all requests that come for a resource in an application will be handled by a single handler and then dispatched to the appropriate handler for that type of request. The front controller may use other helpers to achieve the dispatching mechanism.

What is the purpose of front controller?

Front controller handles all the requests to the web application. This implementation of centralized control that avoids using multiple controllers is desirable for enforcing application-wide policies such as users tracking and security.


1 Answers

Is Page-Controller pattern (the refinement of the MVC pattern) ?

Well to answer this first I would say that you are mixing two different category of patterns. Page-Controller is a software Design pattern and MVC is an Architectural Pattern.
See:Software Design vs. Software Architecture

Page Controller is not usually implemented with the MVC pattern infact ASP.NET MVC employs Front Controller ,(I think MVC can implement both controller patterns ,but we usually see the Front Controller implemented ,that's what MSDN article is discussing)

Rationale For MVC Architechural Pattern:

To ensure that the each part of the MVC are completely separated (Decoupled) from each other. Due to this factor it's easier to modify the presentation (Views) and Models.

Front Controller and Page Controller comes under the category of Application Controller a/c to martin Fowler.

Page Controller Design pattern:

An object that handles a request for a specific page or action on a Web site. Martin Fowler

In ASP.NET WebForms each logical page (*.aspx) is a Page Controller , and its the default behaviour of the page that it's posted back to itself and is handled by the code-behind (which is also the part of page),it basically combines the roles of Views and Controller.

WebForms generally serves request through URL (*.aspx) and ASP.NET MVC generally serves requests through URI.

See:
Page controller on PHPWact.org
Front controller on PHPWact.org

P.S: I must say the MSDN article you mentioned is some what confusing, stick with the Martin Fowler its simple and superb.

like image 166
Owais Qureshi Avatar answered Nov 12 '22 12:11

Owais Qureshi