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
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>