You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Downing <ji...@pobox.com> on 2001/05/03 13:42:26 UTC
Newbie question about form beans
Hi,
I'm new to struts, we're planning to use it to access an EJB tier. I'm
bothered by what seems to be an inefficient and difficult to maintain
pattern were using as a consequence:
A large portion of what our app does is pretty standard - getting a record
out of a database, presenting it to the user in form(s) to be edited, and
then saving the changes back to the database. The structure can be viewed
something like this:- the entity EJB has a set of attributes, with a set of
accessors, and some other stuff. To reduce network traffic we use
ValueObjects, which have the same set of attributes and accessors. This will
get passed into the struts application, where it interacts with a form bean
which has, oh look!: the same set of attributes and accessors, and some
methods to do other stuff.
Surely it should be possible to define a single bean for attributes and
accessors, and wrap it with the functionality it needs at different stages.
I can see my way through doing this in the EJB tier, but not when it comes
to struts - since my form bean already extends ActionForm and multiple
inheritance is unavailable.
Please somebody telling I'm totally missing the trick here!
jim
Re: Newbie question about form beans
Posted by Jim Downing <ji...@pobox.com>.
Thanks. My apologies for not checking the archive well enough...
jim
----- Original Message -----
From: "Jean-Noel Ribette" <je...@improve.fr>
To: <st...@jakarta.apache.org>
Sent: Thursday, May 03, 2001 1:08 PM
Subject: Re: Newbie question about form beans
> Hi Jim,
>
> There has been discussions about this on the mailing list. I suggest you
have a look at the archive at
> http://www.mail-archive.com/struts-user%40jakarta.apache.org/. Look for
"EJB" and specially "communicating with EJB".
>
> Jean-Noel
>
> ----- Original Message -----
> From: Jim Downing <ji...@pobox.com>
> To: <st...@jakarta.apache.org>
> Sent: Thursday, May 03, 2001 1:42 PM
> Subject: Newbie question about form beans
>
>
> > Hi,
> > I'm new to struts, we're planning to use it to access an EJB tier. I'm
> > bothered by what seems to be an inefficient and difficult to maintain
> > pattern were using as a consequence:
> >
> > A large portion of what our app does is pretty standard - getting a
record
> > out of a database, presenting it to the user in form(s) to be edited,
and
> > then saving the changes back to the database. The structure can be
viewed
> > something like this:- the entity EJB has a set of attributes, with a set
of
> > accessors, and some other stuff. To reduce network traffic we use
> > ValueObjects, which have the same set of attributes and accessors. This
will
> > get passed into the struts application, where it interacts with a form
bean
> > which has, oh look!: the same set of attributes and accessors, and some
> > methods to do other stuff.
> >
> > Surely it should be possible to define a single bean for attributes and
> > accessors, and wrap it with the functionality it needs at different
stages.
> > I can see my way through doing this in the EJB tier, but not when it
comes
> > to struts - since my form bean already extends ActionForm and multiple
> > inheritance is unavailable.
> >
> > Please somebody telling I'm totally missing the trick here!
> > jim
> >
> >
>
>
Re: Newbie question about form beans
Posted by Jean-Noel Ribette <je...@improve.fr>.
Hi Jim,
There has been discussions about this on the mailing list. I suggest you have a look at the archive at
http://www.mail-archive.com/struts-user%40jakarta.apache.org/. Look for "EJB" and specially "communicating with EJB".
Jean-Noel
----- Original Message -----
From: Jim Downing <ji...@pobox.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, May 03, 2001 1:42 PM
Subject: Newbie question about form beans
> Hi,
> I'm new to struts, we're planning to use it to access an EJB tier. I'm
> bothered by what seems to be an inefficient and difficult to maintain
> pattern were using as a consequence:
>
> A large portion of what our app does is pretty standard - getting a record
> out of a database, presenting it to the user in form(s) to be edited, and
> then saving the changes back to the database. The structure can be viewed
> something like this:- the entity EJB has a set of attributes, with a set of
> accessors, and some other stuff. To reduce network traffic we use
> ValueObjects, which have the same set of attributes and accessors. This will
> get passed into the struts application, where it interacts with a form bean
> which has, oh look!: the same set of attributes and accessors, and some
> methods to do other stuff.
>
> Surely it should be possible to define a single bean for attributes and
> accessors, and wrap it with the functionality it needs at different stages.
> I can see my way through doing this in the EJB tier, but not when it comes
> to struts - since my form bean already extends ActionForm and multiple
> inheritance is unavailable.
>
> Please somebody telling I'm totally missing the trick here!
> jim
>
>