Can any one tell about the MVC Architecture in STRUTS and the advantages of using MVC Architecture
Can any one tell about the MVC Architecture in STRUTS and the advantages of using MVC Architecture
Hi,
all i am new to this site i dont know how to post queries to the group.Please help me out.
Mvc stands for model view controller architecture. Swing “j” components (e.g. Jtable, jlist, jtree etc) use a modified version of mvc. Mvc separates a model (or data source) from a presentation and the logic that manages it. Swing mvc architecture (e.g. Jtable) component (eg: jtable):view & controller model ui manager uidelegate eg: tablemodel look-and-feel for jtable component (e.g. Jtable, jtree, and jlist): coordinates actions of model and the ui delegate. Each generic component class handles its own individual view-and-controller responsibilities. Model (e.g. Tablemodel): charged with storing the data. Uidelegate: responsible for getting the data from model and rendering it to screen. It delegates any look-and- feel aspect of the component to the ui manager.
Struts provides a framework for writing applications using the MVC architecture. Struts uses "ActionMapping," which enables the servlet to turn user requests into application actions. ActionMapping usually specifies a request path, the object type to act upon the request, and other properties as needed.
The Action object used as a part of the ActionMapping is responsible for either handling the request and sending the response back to the appropriate view (normally a Web browser), or passing the request along to the appropriate model.
The bridge between the model and the view is a form bean that can be created by subclassing org.apache.struts.action.ActionForm. The form bean can be used to hold data from the user prior to processing, or from a model prior to display back to the user. Struts includes custom tags that can automatically populate fields from the form bean created.
The Model-View-Controller (MVC) architecture leverages the strengths of servlets and JavaServer Pages (JSP), while minimizing their weaknesses.
HI,
for any web application client and server require.this is called 2 tier architecture.
In this, client is responsible to develop presentation logic and business logic.
and server is responsible for data storage.
but at client side foolowing disadvantages:
1.business logic developed along with presentation logic
2. resources which are used for develop business logic are allocated at client side.
So we use mvc
In this,
model is responsible for develop business logic
view is responsible for develop presentation logic
controller is responsible for flow of execution from request to response.
client is responsible for only to send the request.
server is responsible for store the data into the database.
thanks
shashi
Hi all,
Here my friend's given some good threads to explanations about the MVC.
And with that insparation here iam going to given my view of MVC.
MVC Interms of Struts:
View: is represtation of data using jsp's/Html's where we will use struts-html,struts-bean,struts-logic tags are used to represent data or input the data.
Controller: When it comes to controller part ActionServlet & Action classes are used as controllers.When User send the request from view it is handled by action servlets and forward it to appropriate action calss.
Model: In struts Java beans and DAO classes are represents the model.A Java bean is simple java class contains getters and setters.when user send the request the form properites are automatically set in to form bean properties and sent for processinng the request.
Thanks & Regads
Srikanth