Recently, I got a chance to understand Front Controller. It was used in massivmvce application level architecture  to modify centralized all the configuration. It includes all the routing, security, authentication, database tier, domain and actions. Before drill down Front Controller we need to know what actually  Design Pattern & MVC is.

 

Hope, you are now familiar with popular MVC Design Pattern. Now we can understand the motivation behind Front Controller. Since, its little complex for fresh and students but ill try to tell you in simple terms.

 

Guess the Problem ??

If we allow user to access the view directly without any centralized mechanism or system service, we suffer a redundancy of code for each view and we may mess between view content and view navigation. In short, we need to add, a lot checks before each views. For a complicated and massive application we can’t afford this approach. Moreover we can’t achieve reusability and flexibility through this scheme.

So, how can we achieve best construction of architecture for very dense Web Application??

Definition

So here is the definition what I got from different website.

It’s a single component that is responsible for processing application requests. A front controller centralizes functions such as view selection, security, and template, and applies them consistently across all pages or views.  The following diagram describes the definition.

 

web-framework1

 

As a result, when the behavior of these functions needs to alter, only a small part of the application needs to be changed: the controller and its helper classes. Hence, The Front Controller handles all requests for a web based application, deciding what happens next.

Stay alive ill update Font Controller later on my next post. Don’t forget to comment, if you like it !!