The Model-View-Controller (MVC) Design Pattern

Struts1.3 framework implementation of Model-View-Controller (MVC) design patterns in JSP web applications, which offers many benefits to the web application developer.
The MVC Model 2 paradigm applied to web applications lets you separate Presentation logic (for example, HTML and Custom Tag libraries) from Workflow control logic (Filter Dispatcher) and model logic( Action Class). 


Brief description of   Model-View-Controller (MVC):-
·         The Model portion of an MVC-based system typically comprises JavaBean classes that define the internal state of the system; they also specify the actions that can be taken to change that state.Data Access from any data source database, flat file, web service, Entity Bean, LDAP server etc.
·         The View manages the display to the end user and portion of a Struts-based application is generally constructed using JSP technology. JSP pages can contain static HTML and Custom Tag library .Which are handle by Result component of Struts1.3 framework.
            
The view have following tasks :-
           1. Show hypertext, images, forms to the user
           2. Retrieve processed data from the model and display to the user along                with hypertext, images.
           3. Client side validations
           4. Server side validations

·         Controller is the layer between View and Model. The Controller portion of the application is focused on receiving requests from the client (typically a user running a web browser), deciding what business logic function is to be performed, and then delegating responsibility for producing the next phase of the user interface to an appropriate View component.Which is handle by FilterDispatcher component of the struts1.3 framework.
            
The controller have following tasks :-

         1.When  a View sends the request, the Controller finds appropriate Model component and forwards the request to this component.

          2.Receives the response from the model and routes the data to appropriate View component.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More