May I make a suggestion. Consider a 3 page wizard (3 forms). you could
have a wrapper bean for all three forms like we do in EJB with enterprise
beans and dependent objects, but this would be for the front end. that way
you could even reuse ActionForm(s).
Ex.
1st page = name/address
2nd page = purchase items
3rd page = credit card information
Each ActionForm bean would be an attribute to a bean called
PurchaseValueObjectBean
PurchaseValueObjectBean{
NameAddressForm
PurchaseItemsForm
CreditCardInfo
validate()
}
I could then call validate() on the PurchaseValueObjectBean which would call
validate on all three beans.
Of course this is assuming that the PurchaseValueObjectBean must know about
the beans it holds, and it should I believe.
Any ideas?
----- Original Message -----
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 15, 2001 9:34 AM
Subject: Re: Client/Server Side Validation for Struts 1.1
> I've gotten down to a 15,000 foot view of Barracuda, and it looks like
> they are doing some nice work. All things remaining equal, I believe it
> would be better if our approaches were compatible with Barracuda. For
> example, if someone did want to do more with event processing, using as
> much of Barracuda's as we can would be excellent, if nothing else is
> compromised.
>
> I would say that having distinct ActionForm's and databeans are a
> necessary evil, in order to keep Struts loosely coupled with the
> business layer. Though, techniques to generate both from a common
> defination would be a real leap forward.
>
> I'd also say that on a validation error, we should always return exactly
> what the user entered without any transformations. The user's data
> should be considered immutable, except by the user (at least until is
> fully validated and submitted to the business layer), or by some
> client-side helper that did the transformation then and there (which
> would also have to be done server-side since we can't rely on the
> clients!).
>
> David Winterfeldt wrote:
> >
> > I just wanted to put this out there to see what people
> > think since I took the time to look at how Barracuda
> > worked. I like the idea of not having two classes
> > (ActionForm and a data bean), but I guess there will
> > be a few different tools to autogenerate these as time
> > goes by. Do you autogenerate classes based on the xml
> > file? You have all the information in the xml file to
> > make this possible, right? I think most of the issues
> > you mention could be worked around, but you're Mapper
> > idea is much more flexible. Is any source for what
> > you've done available to look at or is it proprietary
> > (I do have the xml file you sent to the list)?
> >
> > David
>