The ActionForm beans can contain nested references, so you could just
set some other bean to it, then refer to myBean.propertyThis and
myBean.propertyThat. Of course, the other bean would have to have
standard String accessor and mutators, which is where it starts to fall
down. The other beans may need to use native types, and would want to
reject or transform an incoming String value being set to type. So if
you need two storage locations, joining the two classes loses its edge.

In general, I would say that ActionForms can be coupled to other beans,
but other beans should not be coupled to ActionForm bean (import the
Struts class). Because, in another environment, the ActionForm beans
might be replaced with another class that hooked up to non-HTTP user
interface (say, Swing), and we would want to be able to drop those in.
Of course, the other beans could be designed to accept values from any
given JavaBean via reflection, which would include an ActionForm bean.

It's my feeling that proper MVC/J2EE design implies that we are going to
be stuck with a set of ActionForm beans and a set of other beans, and
need to find the best way to transfer data between the two. 

Jonathan Asbell wrote:
> 
> I was on this track in another thread where I was saying.......
> 
> "What if ActionForm was an inner class to a Value object.  Or, what if a
> Value object had a reference to an ActionForm which when filling with
> parameters we did ActionFormValue.getActionForm(), filled it, complete "does
> it exist" checking and non-business object validation checking, and then do
> a ActionFormValue.setActionForm(ActionForm myform) to set it back, which
> would fill the ActionFormValue object with the values in the ActionForm. An
> "ActionValue" could hold 1 or more ActionsForm(s) , or could take ActionForm
> as a parameter, with which it would copy and "nativeize" the data in the
> ActionForm.  In this case an ActionValue would hold specific fileds for the
> beans it uses."
> 
> My point here,....though I hope it is apparent, is that we need to send
> value ojects through the system in a way in which it can complement/work
> with Struts.

Reply via email to