The Model-View-Controller
architecture Model helps to devide an application into three different categories i,e Model,
View and the Controller.
Components of the MVC
architecture is independent of
other component and has unique
responsibility.Changes
in one component will have
less or no impact on other
components.Responsibilities
of the three components are:
Model:Model is
used for providing
the data from the database
and saving the data into the
data stores.In
Model,all the business
logic are implemented .Before saving
into the database,data entered by the
user through View are checked
in the model.Data
access,the Data saving logic and Data validation
are
part of the Model.
View: View is
responsible for the taking the
input from the user,
dispatching the request to
the controller and then
receiving response from the
controller,displaying
the result to the user and represents
the user view of the
application.
HTML, Custom Tag
Libraries,JSPs and Resources
files are part of the view
component.
Controller: Controller
is intermediary between
the View and the Model.For receiving
the request from the client,Controller
is used.
Once request is received
from the client it executes the
appropriate business logic
from the Model and then it uses the
View component to produce the output.ActionServlet,ActionForm,
Action, and
struts-config.xml are
part of the Controller.
|