• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts ActionForms and DataBeans

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question that falls between matters of taste and best practicies.
I am new to using Struts in a MVC architecture. I have done a good deal of three-tier programming using DataBeans to pass information between the tiers. One specific practice I use is a so-called "TransportBean" that can hold a vector of DataBeans so that multiple results can be returned from a DBMS search. Each value returned is then likely to be represented as an independent DataBean -- call it an EntryBean or a ResponseBean.
Now, consider a Struts UI that will interface to such an architecture. I don't want to use ActionFormBeans as EntryBeans or Request/ResponseBeans because of having to import the org.apache.struts.action.ActionForm in the EJB container classes and becuase it seems like it shouldn't be sent to the backend, anyway.
Where is the most apporpriate place to map from ActionFormBeans to, say, a set of RequestBean/ResponseBean classes that will be sent to/from the EJB container? It could be done in the Model component, but although FormBeans are not supposed to be bound to a particular UI Form, they do have a strong associaiton with such. It could be done in the ActionForm component. That has the advantage of leaving the Model more general (i.e., not having to know about ActionFormBeans) but requires a mapping in the Control Components. This has the disadvantage of adding more funtion to a component one would like to keep as simple as possible (i.e., focused on the control task) and it will require mapping methods for each such action.
I'd appreciate perspectives and suggestions on this.
thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic