Any Design Pattern for Struts?


Web tier: servlets, JSP, Web frameworks: Any Design Pattern for Struts?

  1. Any Design Pattern for Struts? (4 messages)


    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?



    Threaded Messages (4)

  2. regarding DAO[ Go to top ]

    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
  3. I want to know, What is MVC2 , can you tell me difference between MVC1 and MVC2.
  4. Any Design Pattern for Struts?[ Go to top ]

    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!

  5. use BeanUtils with DAO[ Go to top ]

    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.