You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vijay K Dasari <kr...@ecarey.com> on 2004/12/22 14:51:16 UTC

Inheritance of DynaActionForms

Hi,
I am looking for a "Best practice" of using the ActionForms. We are using
lot of Forms(both ActionForm and DynaActionForms) in our application. All
these Forms share some common properties and some validation logic is also
common.

Currently we are using the Inheritance in the ActionForms, to solve this
requirement(Like we have a Super ActionForm and all the other ActionForms
extend that Super ActionForm).

I would like to know, is there any possibility with the DynaActionForms. I
mean, we configure the properties of DynaActionForm in the
struts-config.xml, is there a possibility that we can say that one
DynaActionForm extends other DynaActionForm ? (with out replicating the
properties in all DynaActionForms)

As the struts-config.xml is an XML file, i guess we can imitate this by
using the XML INCLUDES( we include the super DynaActionForm properties in
the child DynaActionForms). Is there any configuration possible in
struts-config.xml ?

I wonder what are the advantages of DynaActionForms(whose properties are
configured in struts-config.xml) over ActionForms(which are Java Classes
created as JavaBeans) except the creation of extra java classes ?

Thanks,
Vijay.





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Inheritance of DynaActionForms

Posted by Radu Badita <ra...@gmail.com>.
Regarding the inheritance of DynaActionForms I've once read an very good 
and interesting article of someone who found an workaround. I don't have 
the url though, so maybe you'll get lucky with google ;-)

>Hi,
>I am looking for a "Best practice" of using the ActionForms. We are using
>lot of Forms(both ActionForm and DynaActionForms) in our application. All
>these Forms share some common properties and some validation logic is also
>common.
>
>Currently we are using the Inheritance in the ActionForms, to solve this
>requirement(Like we have a Super ActionForm and all the other ActionForms
>extend that Super ActionForm).
>
>I would like to know, is there any possibility with the DynaActionForms. I
>mean, we configure the properties of DynaActionForm in the
>struts-config.xml, is there a possibility that we can say that one
>DynaActionForm extends other DynaActionForm ? (with out replicating the
>properties in all DynaActionForms)
>
>As the struts-config.xml is an XML file, i guess we can imitate this by
>using the XML INCLUDES( we include the super DynaActionForm properties in
>the child DynaActionForms). Is there any configuration possible in
>struts-config.xml ?
>
>I wonder what are the advantages of DynaActionForms(whose properties are
>configured in struts-config.xml) over ActionForms(which are Java Classes
>created as JavaBeans) except the creation of extra java classes ?
>
>Thanks,
>Vijay.
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Inheritance of DynaActionForms

Posted by Eddie Bush <ea...@gmail.com>.
Hi Vijay,

Comments intermixed.

On Wed, 22 Dec 2004 08:51:16 -0500, Vijay K Dasari
<kr...@ecarey.com> wrote:
> Hi,
> I am looking for a "Best practice" of using the ActionForms. We are using
> lot of Forms(both ActionForm and DynaActionForms) in our application. All
> these Forms share some common properties and some validation logic is also
> common.
> 
> Currently we are using the Inheritance in the ActionForms, to solve this
> requirement(Like we have a Super ActionForm and all the other ActionForms
> extend that Super ActionForm).
> 
> I would like to know, is there any possibility with the DynaActionForms. I
> mean, we configure the properties of DynaActionForm in the
> struts-config.xml, is there a possibility that we can say that one
> DynaActionForm extends other DynaActionForm ? (with out replicating the
> properties in all DynaActionForms)
>
> As the struts-config.xml is an XML file, i guess we can imitate this by
> using the XML INCLUDES( we include the super DynaActionForm properties in
> the child DynaActionForms). Is there any configuration possible in
> struts-config.xml ?

There is, as I said just yesterday, in response to the exact same
question, asked by Amit Gupta, currently no mechanism to facilitate
this.  Yes, you could hack your XML with includes - there's not an
auto-magic way to do it though.

> I wonder what are the advantages of DynaActionForms(whose properties are
> configured in struts-config.xml) over ActionForms(which are Java Classes
> created as JavaBeans) except the creation of extra java classes ?

Primarily, the advantage I see is that you don't have to code multiple
sets of classes (1 for data transfer - 1 to use in your code that has
all the real types).

> Thanks,
> Vijay.

-- 
Eddie Bush

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org