Struts 2
Struts is an open source
framework in java that extends the java servlet API. Struts architecture is based
on MVC pattern it means Model, View and Controller.
Model: Model
represent to the business component to the application means store and
retrieving data from the backed database transfer to the presentation layer via
controller.
View:
View
is a presentation layer it is present to the handling the request and response
from the client and interact with the business component for Insert/update/retrieve
data from its status and show to the client as response.
Controller: - The controller module acts as an interface
between view and model. It intercepts all the requests i.e. receives input and
commands to Model / View to change accordingly
Main
Controller Class: Action Servlet is main controller class which
handle all request are coming from client and decide to call which action is to
need call to getting response from the server side.
Work
flow of Struts MVC
Advantage of MVC Architecture
- Navigation
control is centralized Now only controller contains the logic to
determine the next page.
- Easy
to maintain
- Easy
to extend
- Easy
to test
- Better
separation of concerns
Disadvantage
of MVC Architecture
- We need to write the controller code self. If we change the controller code, we need to recompile the class and redeploy the application.
No comments:
Post a Comment