Hi guys. I've got a struts application design question for the group. I've got a webapp which guides the user through creating a large model object. The process takes several pages - each page has its own form bean which is used to update the model object (which has no real notion that it's in a struts app) - pretty standard stuff, I think.

I'd like to offer the ability to load and save the model objects. That's relatively straightforward, but I'm not sure how to handle the struts objects. Upon loading a new model object and putting it in the user's session, I need to arrange to have form beans whose values represent the current state of the model object put in the proper places. Otherwise, when the user pages through the app, they'll see the default empty values on the forms, not the model object's values.

I guess I see two basic strategies. I could save all of the ActionForm objects along with the underlying model object, or I could make some sort of adapter class which creates (derives?) form beans for a given model object. The latter option is more work, but it seems cleaner in the long run. My problem is, I don't know where to put that component or when to activate it, I'm a little fuzzy on when and how new ActionForm instances are places in the expected contexts.

It would seem that this design pattern wouldn't be uncommon for larger struts webapps. What do y'all recommend?

- donald


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



Reply via email to