It all depends on how much maintenance you expect this project will require once 
you're finished. If it's a fire-and-forget, any shortcuts will do so long as you 
finish the project on time. If you're going to have to maintain this, you want to do 
it properly.

With this in mind, actions should be 'dumb' things that just call your Manager classes 
to actually do the work. With this, you end up with tons and tons of actions, but the 
good aspect is that they're all trivially simple and should be extremely bug-free. 
This way you can concentrate on the manager and DAO classes for 
bug-writing-and-finding...

So the idea is to have as many forms as required (each with its own form-bean and 
potentially two associated actions - one to populate the form options/selects/radio 
buttons/etc, one to retrieve the results and update the database), without trying to 
"consolidate" things that look the same into, say, a single action with a couple of 
if/thens. Don't go into a mode of thinking where you're trying to save on how many 
actions there are - why do you want to do the work of 2 actions with one?? If you are 
repeating any non-trivial code in your actions it's a fair bet that you have code in 
there that shouldn't be there.

Doing it this 'right' way will force you to produce large quantities of trivial code 
but that's the good thing - it's all trivial, it's all easily maintainable, it's all 
easy to change, it's all very clear to any struts programmer.

I suggest getting a good book such as Ted Husted's Struts in Action to get the basics 
right before you get onto this project by the way, otherwise you'll have no end of 
trouble.

To your question about tiles, yes, tiles is excellent and personally I see no reason 
*not* to use it in every web-based project.

-- 
If education is too expensive, try ignorance.


On Mon, 14 Jul 2003 16:40:07 -0700
Mohan Kalyanasundaram <[EMAIL PROTECTED]> wrote:

> > Hi,
> > 
> > I am new to Struts and I have to complete a project with an aggressive
> > deadline. I want to know the following:
> > 
> > My application will have about 80-100 screens each having different action
> > items. Most screens will have a common header, footer, and a navbar. My
> > questions are:
> > 
> > I thought of using Tiles for my application. Is that a good idea.
> > -   Should I have to have one action form for each screen or can I group
> > the screens and have one action form for a group of screens. Which would
> > be a preferred method?
> > -   Should I have to have one action class for each screen or can I
> > group the action classes the same way as forms? Which would be a preferred
> > method?
> > -   Every screen of mine is going to be a jsp page. I want to populate
> > the form data at the time when someone enters the page from another page
> > and I want to write the data into the database at the time when the user
> > leaves a page with an action. Is this possible in the same action class?
> > How does the flow work? Does the control go to the action class first
> > before the form data is picked up for display. If that is the case, will
> > there be an easy way for me to set the form data from the same action
> > class for the form before the data is displayed? Where can I see a sample
> > code if I use one single action class for loading the data and for
> > processing the actions within the form? What should be the setting within
> > the struts-config file for the above scenario.
> > 
> > Sorry, if my questions are dumb. I need help.
> > 
> > Thanks in advance,
> > Mohan
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to