This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Question

 
Saikiran Madhavan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am not sure whether i can put this question in this section.But still i didnt found any new topic for Struts, so i am putting this question with this section.


I am starting a project with Struts Framework (1.2). I just want to know how to use design patterns like VO, DAO in it.

I understand design patterns, but i didnt implemented any of them still...can anyone point out some useful link which has complete or partly implementation of these patterns with Struts...

Regards
Saikiran
saisen76@hotmail.com
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like a valid question for this forum. I have two general comments on this. First off, I would not recommend implementing design patterns just for the sake of implementing design patterns. Certain patterns, such as the DAO pattern, are useful in a number of situations but you should let your technology, architecture and requirements drive the patterns that you use.

As far as "implementation of these patterns with Struts", Struts is a presentation layer framework. You mention the DAO and VO patterns. These patterns are more data and business layers patterns. While they can be used in architecture along side Struts, they are not related to Struts and you would not implement them with Struts. Struts is generally viewed as an implementation of the MVC pattern.

- Brent
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's nothing special to know about using J2EE patterns in a Struts applications. Struts assumes you will write your own model classes, and it's entirely up to you how you write them. Once you have written your model classes, it is your Action class that will instantiate them and call methods on them to do the actual work of the application.

So, for example, if you know how to create an object that follows the Data Access Object (DAO) pattern, go ahead and create one. Then instantiate it in your Action class and use it to do the work of your application.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic