Hi,
I just want to know any design pattern for struts framework. For instance, in JSP and Servlet, FrontController steers all the JSPs and Servlets. And also, how to use DAO from struts?
Thanks.
sithu
SJSU
-
Any Design Pattern for Struts? (4 messages)
- Posted by: sithu aung
- Posted on: June 03 2004 00:02 EDT
Threaded Messages (4)
- regarding DAO by krishna kishore on June 03 2004 02:51 EDT
- difference between MVC1 and MVC2: by Vivek Barsagadey on March 25 2010 05:47 EDT
- Any Design Pattern for Struts? by Joe Attardi on June 04 2004 12:27 EDT
- use BeanUtils with DAO by Charles Gibbons on July 05 2004 11:59 EDT
-
regarding DAO[ Go to top ]
- Posted by: krishna kishore
- Posted on: June 03 2004 02:51 EDT
- in response to sithu aung
Struts1.0 follows MVC architecture and Struts 1.1 follows MVC2 architecture which is designed using Front Controller Design Pattern ..
DAO is a simple java file which contains setter & getter methods (mutator &Accesor) for a table in database.
the action class is responsible for set and get operations of data in the STRUTS frame work and instead of using every time openning a connection object and holding a connection to the data base increases the network trafic and database access is expensive .. a DAO is written with some defined methods like for Openning a connection , close a connection , getting a result set ,etc ..etc ..
DAO is used .
krishna kishore -
difference between MVC1 and MVC2:[ Go to top ]
- Posted by: Vivek Barsagadey
- Posted on: March 25 2010 05:47 EDT
- in response to krishna kishore
I want to know, What is MVC2 , can you tell me difference between MVC1 and MVC2. -
Any Design Pattern for Struts?[ Go to top ]
- Posted by: Joe Attardi
- Posted on: June 04 2004 12:27 EDT
- in response to sithu aung
The Struts Action classes and their associated action mappings are like the Command pattern. Also, the Form Beans that encapsulate the values entered on a form, these are like a Context Object.
As far as using DAOs:
Your Action implementation will do some initialization stuff, but then once it gets to start processing data/business logic, this stuff should be placed in an Application Service or Session Facade. Then, from within these, you can just create and use a DAO like you normally would.
I hope this helps!
--Joe -
use BeanUtils with DAO[ Go to top ]
- Posted by: Charles Gibbons
- Posted on: July 05 2004 11:59 EDT
- in response to sithu aung
The BeanUtils.populate()and describe() methods are helpers for transfering data of arbitrary types when working between a DAO in the Model and an ActionForm.
Make sure that the names of public properties match and you use native types.
Chas