I have a wizard kind of multipaged form. The user can leave the wizard at any stage and logoff or change section. When he comes back, he's supposed to be presented the same stage,and with all the data so far, including current page.
For this I'm using combination of DispatchAction subclass, single ActionForm with some of the VO being part of the form bean, and the status of the wizard being maintained in the DB.
My Question : What should ideally be the scope of the ActionForm bean? I can easily get my work done by keeping the scope to be session. But should I really be doing this? If not, then what could be the approach to this scenario.
Once the wizard is over, the user logs off, or changes the application section, I use a convenience clean-up method to clean session scope.
Wizards are usually the only reason for ever using session.
Your answer depends on your situation of requirements. Placing them in session takes up more memory, but if you don't place them in session you'll need to make more persistence and retrieval calls to the backend which takes up more processing power (and often network traffic).
A good workman is known by his tools.
Joined: Jun 06, 2003
Well, as far as this application is concerned, DB calls does not seem to be a big issue, as the DB is very well tuned and is handling really high amount of traffic. But, one of the reasons why I'm keeping data in session is because my DAO layer is comparatively much weak in design and we are using an inhouse persistance framework. The next section of the application may have hibernate or toplink, as I've been able to convince my boss for the need.
Handling the various aspects of wizards in a web application can get pretty hairy. I suggest you checkout Struts Workflow Extension, it sounds like it does everything that you would want for wizards (with the exception of the allowing the user to logoff and return to the same workflow). We are using it on a current project and it has actually worked out pretty well.
Joined: Jun 06, 2003
Hmmm.. Interesting link. I would like to integrate this into my application in the next phase. Since so much of work has already gone into the application, I think it'll be a little difficult to integrate this in current scenario. Requistion for the next phase already arrived from the client. So, it seems, I would continue the same strategy for the current module.