Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

General questions for Ted

 
Eric Fletcher
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ted Husted
Author
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eric Fletcher
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ted, I really appreciate the reply.
E
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic