Well, you would use the following form-bean
definition.

<form-bean name="sampleForm"
type="xyz.domain.DynaActionFormSubClass">
  <form-property name="lastName"
type="java.lang.String">
    <set-property>
      <property>model-property</property>
      <value>custLastName</value>
    </set-property>
  </form-property>
  ...
  ...
</form-bean>

Customize BeanUtils to copy the properties of
DynaActionFormSubClass to a model-property-keyed map.
pass this map to the model layer and have an adaptor
in the model layer copy these porperties to the
required model objects, again using BeanUtils.

-Harish

--- Puneet Agarwal <[EMAIL PROTECTED]> wrote:
> Thanks for your views,
> My basic intention is to avoid the headache of
> copying the values from
> FormBean to my Model layer.
> and that since formbean keeps all the values in a
> nice manner that can be
> adaptive to any framework.
> 
> Well this is a correct point that we should keep our
> Model layer separate
> from strutsish components.
> 
> but Harsish's Idea sounds good, would be nice if
> Harish could say something
> more about his approach.
> 
> Regards
> Puneet Agarwal
> ----------------------------->
> "Struts"..."Action"..."Struts in Action"..."Action
> in
> Struts"...[possibly]"Action with Struts"...?
> ----- Original Message -----
> From: "harish krishnaswamy" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Sunday, March 09, 2003 3:09 AM
> Subject: Re: [Design Pattern]FormBean in Model Layer
> 
> 
> > In our project, we have designed our model facade
> > objects to take in a map and let the facade copy
> the
> > map to the appropriate business objects using
> > BeanUtils. We have customized the form-bean config
> to
> > map the form-bean properties to the model
> properties.
> > This way the model objects will be independent of
> the
> > view/controller.
> >
> > -Harish
> >
> >
> > --- David Graham <[EMAIL PROTECTED]> wrote:
> > > That is a terrible idea.  Form beans should
> never
> > > make it out of the
> > > Struts/view layer.  You will tie your
> application to
> > > Struts and make it
> > > impossible to reuse the logic in another
> application
> > > or even to stop using
> > > Struts in the future.
> > >
> > > David
> > >
> > >
> > >
> > > >From: "Puneet Agarwal"
> <[EMAIL PROTECTED]>
> > > >Reply-To: "Puneet Agarwal"
> > > <[EMAIL PROTECTED]>
> > > >To: "Struts Users Mailing List"
> > > <[EMAIL PROTECTED]>
> > > >Subject: [Design Pattern]FormBean in Model
> Layer
> > > >Date: Sun, 9 Mar 2003 02:45:15 -0000
> > > >
> > > >We are in the stage of finalizing the design
> > > pattern for our project.
> > > >
> > > >While discussing the design patterns with my
> > > colleagues,
> > > >somebody came with an idea to pass the FormBean
> as
> > > it is,
> > > >to the Session Bean or sometimes even to the
> Value
> > > List handler Block
> > > >Later I thought this can actually be a good
> idea.
> > > >
> > > >I understand that this is against underlying
> > > layered MVC pattern itself,
> > > >but
> > > >avoids a lot of headache. Can someone say what
> > > could be other disadvantage
> > > >of this.
> > > >
> > > >
> > > >
> > > >
> > > >-------------------------->
> > > >"Struts"..."Action"..."Struts in
> Action"..."Action
> > > in
> > > >Struts"...[possibly]"Action with
> Struts"..."Action
> > > over Struts"...?
> > > >
> > > >
> > >
> >
>
>---------------------------------------------------------------------
> > > >To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > >For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
>
_________________________________________________________________
> > > Protect your PC - get McAfee.com VirusScan
> Online
> > >
> >
>
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> > >
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Tax Center - forms, calculators, tips, more
> > http://taxes.yahoo.com/
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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

Reply via email to