my dog learned polymorphism
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

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,

My theory of evolution is that Darwin was adopted. - Steven Wright
Ted Husted
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="" 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.
I agree. Here's the link:
subject: General questions for Ted
It's not a secret anymore!