I prefer the 3rd choise. As far as I known, it's the recommended struts-way to go. One of the reasin is that your bussiness logic is framework independent. In case you need another kind of client instead of browser or your boss like something other than STRUTS,what should you do to your exisiting work?
--- Jordan Reed <[EMAIL PROTECTED]> 的正文:> All, > > I'm on a team that's trying to decided on a best > practice for passing on > populating our value objects that get passed to our > business layer. We > currently have three techniques we've though up and > I'm wonderful if anyone > has a strong opinion on which one may be the "best" > and why. > > The basic problem is that the user enters > information into a form. The form > is a presentation object, and should not be passed > to the business layer. > So it's information needs to be in a > presentation-agnostic interface before > being passed to the data layer. > > 1) Have the action class copy information from the > form to a value object. > Have a view helper copy information from the value > object into the form (for > pre-population) > > 2) Have the form implement a value-object-like > interface. The business > layer accepts objects with these business > interfaces. This way it is > possible to pass the form objects to the business > layer without the business > layer knowing that they are presentation objects. > > 3) Have the form simply include value objects as > properties. Then use the > nested taglibs to populate the value objects. This > way the Action can just > pull the value object off directly and pass to the > business layer. A view > helper can just set the value object on the form. > > > -jdr > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > _________________________________________________________ Do You Yahoo!? 流连网络世界的“你”是谁? http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.surveys.yahoo.com/cn_user_profile_study_may2003 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]