aspose file tools*
The moose likes Struts and the fly likes General questions for Ted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "General questions for Ted" Watch "General questions for Ted" New topic
Author

General questions for Ted

Eric Fletcher
Ranch Hand

Joined: Oct 26, 2000
Posts: 188
Hi Ted,
I am in the design phase of my first big project using Struts and I was just curious what is your general approach to design with Struts in mind?
The approach I have been taking so far is sort of "outside-in", i.e. design the views, build the ActionForms, then handle the Actions. Have you found a strategy like this to be useful?
I realize it can be very application specific but I was hoping maybe you could share some best practices based on your experience.
Thanks in advance,
Eric


My theory of evolution is that Darwin was adopted. - Steven Wright
Ted Husted
Author
Ranch Hand

Joined: Dec 02, 2002
Posts: 37
After getting together the top-level requirements, I generally start with a HTML click-through. At this point, it's a familiar medium for everyone and can be the simplest way to express what needs to be done.
It's then pretty easy to setup the ActionForms using the HTML click-through like a requirements document. Once you have the ActionForms, it's easy to migrate to a dynamic click-through using JSP or Velocity templates. Instead of Actions, you can use the forward property to send control out to the presentation page. At this point, you can also start validating data.
After that, it's a matter of inserting Actions that bring the click-through to life. Here, I may start with stub or mock actions that return the same static data from the click-through. This way I can test how the presentation pages will act when passed data from the controller.
Finally, when I run out other things to do, I break down and hook it up to the persistance layer.
So, yeah, what you're doing =:0)
This is the same general process covered in section 3.4 of the book.
HTH, Ted.


<a href="http://husted.com/struts/book.html" target="_blank" rel="nofollow">Struts in Action</a>
Eric Fletcher
Ranch Hand

Joined: Oct 26, 2000
Posts: 188
Thanks Ted, I really appreciate the reply.
E
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: General questions for Ted
 
Similar Threads
good book for STRUTS.
New to Websphere - J2EE Project.
This weeks giveaway
struts performance
Head First Struts