• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts ActionForms and DataBeans

john b. smith
Posts: 23
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic