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/[email protected]/msg08070.html and http://www.mail-archive.com/[email protected]/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/ box wrote: > > Hi everybody, > > I am new to struts, but I find them very usefull. > > There is one question that bothers me. > > Wy is ActionForm a class not an interface ? > > I have got my own application data model and I would just need to > implement > the ActionForm to update/input the data via html forms. > > But it's not possible - I must inherit the struts structure, so I have to > create ActionForm with get, set methods and after all copy all properties > between my data model and the corresponding ActionForm. > > Am I missing something ? > > regards > > Wojtek > > > -- > Myslisz o otworzeniu wlasnego sklepu internetowego? > A moze o wynajeciu stoiska w wirtualnym pasazu? > W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok. > Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/ > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
