I'm working on a project where we faced a similar 
situation. We don�t have as many pages as you, but 
nonetheless. Here�s what we have done, maybe there�s 
some ideas in here for you.

We built two builder classes that contain a single 
static method in each (FormBuilder and ViewBuilder). We 
are using DynaValidatorForm�s and the action classes 
call the business tier and get back a view hierarchy of 
some sort. We pass this view into the FormBuilder by 
calling a populateForm() method. The FormBuilder 
populates the Map with the view�s attributes and any 
referenced views it knows about. We are using a nested 
notation as the keys, to prevent collisions. So, if this 
is the view hierarchy:

UserView � addressView

And supposed addressView has a property called 
firstName, the key in the map for this value is:

AddressView.firstName

After the DynaActionForm is populated, everything else 
works the same to display the JSP page. The property 
names in the JSP tags have to use the nested notation to 
access properties in sub views, but that�s OK. 

When the client submits the HTML, the DynaActionForm is 
populated as usual, using the property names. The Action 
class calls the method populateView() and passes in the 
DynaActionForm and the top-level view bean and the 
builder does a reversal and builds the view hierarchy 
back.

>From there, the action invokes the business tier and so 
on. It seems to work pretty well for us, but maybe not 
for everybody. Timestamps, Enumerated types, and 
collections are a little tricky to deal with, but they 
can be done in a similar manner. I�m obviously leaving a 
few details out, but you get the point.

Here are some decisions that we�ve made in order for 
this to work:
-       The DynaActionForm only deals with Strings
-       All business logic validation occurs in the 
business tier
-       Input validation is taken care because we are 
using the ValidatorActionForm

Hope that helps,
Chuck
> Subject: ActionForm Design Thoughts..
> From: "Anand Jayaraman" <[EMAIL PROTECTED]>
>  ===
> Hi All,
> 
>     I am designing a Application and would like to get inputs from some
> experienced ones out there.
> 
> 1)     I will be have close to 100 JSP pages and I dont want to write a
> ActionForm for everything.
> 2)     I would like to design a generic one. I thought about DynaActionForm,
> but it does not solve my purpose since I want to have some extra Getters
> other than my defined variables.
> 
> 3) I am planning to design my own ValuObject Map/Colleciton and would like
> to use the nested features to access values by parameters.
> 
>     my thoughts about Value Object
> 
>     VOMap
>      |---- VOColleciton
>                |---- DataBeans
> 
>   Accees Colleciton by name and then the databeans by name.
> 
> Can you run your thoughts and examples if available.
> 
> Thanks in Advance,
> 
> 
> Anand
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 

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

Reply via email to