"Struts-dev Newsgroup (@Basebeans.com)" wrote: > > Subject: Re: FormBeans ... as an Interface. > From: "Vic C." <[EMAIL PROTECTED]> > === > Vic C. wrote: > > OK so some people think I should preach FormBean as a View and not as a > > Model, so here is ... why I do recommend FormBean as Model and you > > should leave the door open.
<snip/> Personally, I'd say that the ActionForms are controller. They capture the input from the view and pass it up to the model, which is the classic definition of the controller layer. In Struts, the controller is a trinity: ActionForward, ActionForm, ActionMapping. We talk about the ActionServlet as the controller, but it is really just a static switchboard for these other objects, which are the programatic components of the Struts control layer. While I don't agree that ActionForm should be an interface, for all the usual reasons, I would agree that it can * implement * a business tier interface. Under some circumstances this can expand it's role from a view => controller DTO to a view => (controller) => model DTO. But the functional requirements of an ActionForm coupled with the design requirements of the JavaBean specification make this option available to a limited number of applications. Happily, post 1.1, many of these issues will start to disappear since more and more developers will choose to use Maps to store formbean properties or go with DynaBeans. We won't be rolling a bunch of custom form bean classes anymore, the ActionForm will become transparent and not considered any more fuss than the ActionForward or ActionMapping. But I think the most important thing to remember about Struts is that it is primarily a way to integrate various technologies within a Web application. There is no one right way to use all these technologies and patterns, and so there will be no one right way to use Struts. Many applications need to interact with other players in the enterprise, and these interactions drive some of the design decisions. What is "best" in one environment may not be "best" in another. Meanwhile, I've just uploaded an update to the Artimus sample application that demonstrates some of the design features mentioned on the list lately. http://www.husted.com/struts/resources/artimus.zip -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>