You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Whittaker <mi...@ntlworld.com> on 2003/05/17 22:07:38 UTC

Action Form beans and their (dynamic?) business class doppelgangers

Very new to struts, and have been reading the archives. In the iterests of
good MVC separation, My business classes will need access to something very
similar to my Form Beans.  Reviewing the BeanUtils API I see mention of much
Dyna this, that, and the other.
I am proposing to create either WrapDynaBean or ConvertWrapDynaBean
instances for each Form Bean.
If I understand their purpose correctly, I will then have exactly the same
properties available, but without any dependency on Struts API code.
Further more it seems that I could also have type conversion at the same
time!
Is this the best thing to do?

Thankyou
Mike Whittaker


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


Re: Action Form beans and their (dynamic?) business class doppelgangers

Posted by Vic Cekvenich <vc...@baseBeans.com>.
I am not sure if Dyna this, that and other is always a good idea. I like 
using form beans instead of Dyna this and that, since they allow me to 
unit test and reuse the beans.

I am not sure what your business classes are, so I can't comment on it.
The approach I like is to have form beans have a DAO helper.
Also, sometimes you want to reuse you Struts code, for example 
validation comes to mind.

You could use bean utils to copy from one set of beans to another maybe 
in your case, I use a list backed formbean.
Don't worry about best thing to do,  good enough is good enough. Since 
MVC separates the layers, it is hard to go wrong.

hth,
.V

Mike Whittaker wrote:

>Very new to struts, and have been reading the archives. In the iterests of
>good MVC separation, My business classes will need access to something very
>similar to my Form Beans.  Reviewing the BeanUtils API I see mention of much
>Dyna this, that, and the other.
>I am proposing to create either WrapDynaBean or ConvertWrapDynaBean
>instances for each Form Bean.
>If I understand their purpose correctly, I will then have exactly the same
>properties available, but without any dependency on Struts API code.
>Further more it seems that I could also have type conversion at the same
>time!
>Is this the best thing to do?
>
>Thankyou
>Mike Whittaker
>  
>

-- 
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA

Advanced <a href ="baseBeans.com">Struts Training</a> and project recovery in North East. 
Open Source <a href ="baseBeans.com">Content Management</a>  basicPortal sofware
Best practice<a href ="baseBeans.com">Struts Support</a> v.1.1 helper ScafflodingXPress




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