struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: STRUTS and EJB
Date Thu, 23 Aug 2001 17:56:53 GMT
Yes, the inheritance is a necessary part of the Struts design. 

I realize that it seems wasteful at first, but the ActionForm beans have
several special needs that may not apply to the other beans in your
application. An interface was tried in the earliest instances of the
framework, but discarded for several reasons. The biggest one is that we
may need to yet add another method, and if the ActionForm was an
interface, everything would break ;-( The other reason was that people
tried to turn their business beans into ActionForm beans, which is
really not a good idea in practice (as seductive as it sounds ;-)

For more see 

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg08070.html

and

http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01495.html

You should also take a look at the BeanUtils for quick and easy ways to
populate beans. I add a toMap() method to all my ActionForm beans,
which, with BeanUtils.populate() can be an easy way to populate your
business beans. In fact, these are so useful, we moved them to
theCommons for 1.1 ;-)

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/


Juha Paananen wrote:
> 
> I also agree on that stuff that has references to STRUTS should not be
> transmitted to the EJB level. The problem here is simply that I would
> not want to make another, exactly similar (except "extends ActionForm"),
> class for transporting the information to the EJB. Of course, I can do
> that, but I don't like the idea. My question is, is this inheritance of
> ActionForm really necessary in Struts design?

Mime
View raw message