<
JaiswalTraining

Get the online training



Corejava Servlet Jsp  Php  Hibernate  Ajax Web Service   Ejb2.1 Ejb3.0 Struts Struts2  JPA Spring Ibatis   JSF    JSF2.0  CoreJavaDesignPattern    Jquery  Flex J2EE-Design-Patterns  Jboss7  Maven  Contact Me                                                                                                                                                                        
            IGNOU SMU PTU Project                                           Training                                                                                                                              
              

Contact Us  0091- 9210721663         jaiswaltraining@gmail.com




Corejava
Servlet
Jsp
Php
Hibernate
Ajax
Web Service
Ejb2.1
Ejb3.0
Struts  
Struts2
JPA
Spring
Ibatis
JSF
JSF2.0
CoreJavaDesignPattern
Jquery
Flex
J2EE-Design-Patterns
Jboss7
Maven







Front Controller Pattern
  • Context
    • The presentation-tier request handling mechanism must control and co-ordinate
      processing of each user across multiple requests..
  •  Such control mechanisms may be managed by a centralized manner
Problem
  •  The system requires a centralized access point for presentation-tier request
    handling mechanism
  • Centralized control mechanism will handle
    •  Integration of system services
    •  Context Retrieval
    •  View Management
    •  View Navigation
  •  Problems that may occur without centralized mechanisms
    •  Each view is required to provide its own system services, often resulting in duplicate code.
    •  View navigation is left to views which results in mixed (blended) view content and
      navigation.
    •  Distributed control is more difficult to maintain as the changes will often need to
      be made in numerous places.
Forces
  • Common system services processing such as authentication and authorization checks.
  •  Logic is handled in one central location
  •  Decision points exist for retrieval and manipulation of data.
  •  Multiple views are used to respond to similar business requests.
  •  Centralized point of contact for handling a request – to control and log a user’s progress
    through the site.
  •  System services and view management logic are relatively sophisticated.
Solution
  • A controller as the initial point of contact for handling a request.
  • The controller manages
    • Handling of request
    • Delegate business processing
    • Manage choice of an appropriate view
    • Handling errors
    • Manage the selection of content creation strategies.


Participants

  • Client
    • Object requesting the generation of the view.
  • Controller
    •  Initial point of contact for handling all requests in the system.
    • Controller may delegate to a helper to complete authentication
      and authorization of a user to initiate contact retrieval.
  • Dispatcher
    • Responsible for view management and navigation, managing the next view to present to the user
  • View
    • Represents and displays information to the client.
    •  Retrieves information from a model
  • Helper
    • Responsible for helping a view or controller complete its processing.
    • Also responsible for gathering data required by the view and store it in the intermediate model.



Strategies

  • Servlet Front Strategy
    • The Front Controller is implemented as a servlet.
    • This is the preferred to the JSP Front Strategy.
  • JSP Front Strategy
    • The Front Controller is implemented as a JSP Page
  • Base Front Strategy
    • Implementing a controller base class whose implementation other controllers may
      extend.
Consequences
  • Centralizes control
  • Improves manageability of security
  • Improves reusability