File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts design issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts design issue" Watch "Struts design issue" New topic

Struts design issue

A knibbs
Ranch Hand

Joined: Aug 23, 2006
Posts: 158
Hi again all I have a somewhat different question about struts, more of a design question than a very specific issue. I have a page that has an address as well a user outline. They are allowed to change either portion, but not both at the same time. Should those each have their own form to use for validation or does it make sense to try and use the same form for both values ? I am pretty certain the answer will come back as (use a form for each value ) as that seems to follow the advice of only group things together that are related, but I want to see what others thought of the idea.

thanks in advance.
Leandro Melo
Ranch Hand

Joined: Mar 27, 2004
Posts: 401

I'd say that it depends on your overall architecture (and time, constraints, etc). If you work with very decoupled components (including not only form-beans, but validation, actions, jsp portions in tiles, etc), it's worth and good to keep things separated (this is the best strategy). On the other hand, if you have a small application that has not been developed with such cohesion since the beginning, and is doing good (from a point of view of maintainability) and does not tend to grow much, I'd stick all data in the same form.
[ June 01, 2007: Message edited by: Leandro Melo ]

Leandro Melo
SCJP 1.4, SCWCD 1.4
I agree. Here's the link:
subject: Struts design issue
jQuery in Action, 3rd edition