John Yu wrote: > To a certain extent, this consequence is 'historical'. If the formbean api > had been decided not to tie up to the Struts and servlet API, we would not > see this dependency problem. So, I think one outcome of this discussion is: > 'does it make sense to "correct" this historical issue to allow less > restrictive usage of formbean by changing the formbean api?' > > To me, the discussion is getting a bit religious, pragmatism vs > idealistism. On one hand, from my consulting experience, I share Vic's > sentiment. On the other hand, I find it's inelegant when the boundary of > the layers gets blur. (Hmm, it seems I'm not adding any value here...)
It doesn't seem pragmatic to me to take the HttpRequest and ActionMappings out of the validate signature. There are many valid, practical uses for these objects here and removing them seems counter-productive. AFAIK, the core complaint with the ActionForms has been maintainence of the properties. Since in the post-1.1 era, ActionForms can be backed by a Map or a DynaForm, I believe maintenance becomes a non-issue. A Map-backed ActionForm can take whatever you want to throw at it, and a single BaseActionForm could be used by every Struts application in an enterprise unchanged. Of course, there's still data transfer. But there are several good ways to do this now, including defining an interface for the business bean that the ActinForm can implement, using BeanUtils and some helper methods for the fancier types, or convincing the business beans to fetch whatever parameters they need from a Map. In any case, the data transfer is not so much about Struts is it is about transfering data between application layers using Strings. This has always been a common need in computing. Witness JDBC's ability to accept and return any data type as a string. Expecting our business layers to do the same seems like a reasonable design feature to me. And if they don't, then I'd say its time to add an adaptor (to the business tier). Of course, there is still a need for a good utility package to handle type conversions and String transformations. But that would be useful to a great number of Java applications, and is outside of the scope of Struts itself =:O) -- 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]>