No. You class operations would have DynaBean as the argument
and you would access the values using its public methods
get() and set().
For example, let's say I have a form bean defined in struts
called MyDynaForm which extends DynaValidatorActionForm.
Let's also suppose I have a service delegate called
MyService which has an operation called doSomething
which takes a DynaBean as an argument.
In the XXXXAction class:
DynaBean args = (DynaBean) form;
MyService service = //get service
service.doSomething(args);
Inside MyService.doSomething:
public void doSomething(DynaBean args) throws SomeException {
String email = args.get("email");
String userName = args.get("userName");
// do logic
// populate args with data
Collection someData = // get some data
args.set("data", someData);
}
There is a loose coupling because MyService must know
the property names of the DynaBean argument. This is not much
different that MyService using a concrete API to extract
data. It's just that one is validated at compile time and
one is validated at run time.
HTH,
robert
> -----Original Message-----
> From: Rick Reumann [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 08, 2003 5:22 PM
> To: Struts Users Mailing List
> Subject: Re[2]: Model Layer question.. where to put
> BeanUtils.copyProperties (sort of long)
>
>
>
>
> On Wednesday, January 8, 2003, 5:07:24 PM, Robert wrote:
>
> RT> If you are using DynaActionForm or DynaValidatorActionForm
> then you can
> RT> cast the form to a DynaBean in your Action class and pass it
> to the business
> RT> layer.
> RT> This does not couple your business/service layer to Struts.
> It does however
> RT> couple
> RT> your service layer to accepting DynaBean interface.
>
> Well in one app that's exactly what I did (using DynaValidatorForm)
> but how does this still not tie your service layer to Struts?
> Wouldn't it require my class to use org.apache.struts in order to get
> acces to DynaActionForm or DynaValidatorForm ?
>
> --
>
> Rick
> mailto:[EMAIL PROTECTED]
>
>
> --
> 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]>