Hi Ted,
Thanks a lot for pointing it out, I fully agree. We should conform to
Struts ActionForm and ActionClass, but that does not mean for every button
in the form, we have to use a different form, a different action class.
Thanks,
Sharon
-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 20, 2001 5:30 PM
To: [EMAIL PROTECTED]
Subject: Re: a question
There's no requirement that 3 different pairs of ActionForms and Actions
be used. They could just as easily be handled by one. That's an
architectural decision that is up to the developer.
The greatest advantage is that using an Action can remove scriplets from
the JSP. The Action can acquire whatever dynamic data is needed by the
JSP and deliver it in the request. This way the JSP can focus on
displaying data rather than acquiring it. You can change the way data is
displayed without touching the business logic, and, conversely, change
the business logic without touching the way data is displayed. The
overall design is much cleaner, and IMHO, much easier to document and
understand.
The Struts Actions are very performant, especially when used to handle a
suite of tasks rather than a single purpose. The processing has to take
place someplace. It's just a matter of whether you want to mix it all up
in the JSP, or move to a specialized object.
"Yang, Sharon" wrote:
>
> Hi,
>
> If every request to be mapped to an Action class, what advantage of this
>approach?
> For example, if originally I have 3 buttons within one HTML form in the old
>design,
> Now I want to change to use 3 different pairs of Struts ActionForm and
>ActionClass, just try to gain
> the clarity and separation of the logic, I wonder if this would cause a lot
>of overhead, or
> would this be too cumbersome for WEB designer to figure out.
>
> Thanks,
>
> Sharon