From: <jue...@we...> - 2003-03-04 16:41:30
|
Hi everybody, I've recently browsed through the thread "Struts design flaw -- = ActionForms are not true domain objects" on the Struts mailing list. = Obviously, some people treat that as a religious issue - after all, form = handling, i.e. the design of the ActionForm class, is a central aspect = of Struts. Interestingly, Rod's book is explictly mentioned and = discussed. There seem to some real fans of Struts' design, e.g. = http://nagoya.apache.org/eyebrowse/ReadMsg?listId=3D42&msgNo=3D64642: "Now does it break this book's opinion of proper design patterns? I'm = sure it does, but what GREAT engineers don't break design pattern rules = when it benefits the end result of an application or framework? Patters = are there to solve issues we have, not to stick us into lala land with = shackles and whips telling us that we must do it that way. They're = merely there to help us write better OO design, and from where I sit the = Struts design is as close to perfect as you can get right now=20 for WEB-based development." An interesting and quite offensive posting is the following one, from = Peter Pilgrim, dedicated "Struts Consultant" (who also wrote some = Expresso article for TheServerSide, IIRC): http://nagoya.apache.org/eyebrowse/ReadMsg?listId=3D42&msgNo=3D65119. He = virtually dismisses Rod's views on Struts' flaws in the twinkling of an = eye. Now that's what I call open discussion... So everybody seems to love writing ActionForms and copying the = properties to the respective domain objects on submit, using Commons = BeanUtils. I don't consider this elegant, but I respect their views too. = I simply believe that there is a better way. I consider the ubiquitousness of ActionForms an even greater design flaw = of Struts. Struts' Action API only knows one single execute/perform = signature, with ActionMapping, ActionForm, HttpServletRequest, and = HttpServletResponse. This is inflexible and inelegant. Of course, the = form may be null, according to your action mapping declaration. = Generally, why do I have to declare form beans in a descriptor? And = ActionMapping is basically just needed for resolving symbolic view = names. All things considered, the Action/ActionMapping approach is at = least as flawed as the ActionForm class. Of course, anybody is free to choose and even like Struts' approach. = BTW, what's the status of our proposed Struts plugin? I really like that = idea because it gives the application developer choices. After all, = Spring is more than "just" a web framework, and deserves to get used in = a wide variety of scenarios. It offers such appropriate generic = infrastructure for the middle tier, with nice integration with but clear = separation from the web support on top of it. Anyway, IMHO Spring's way of web MVC is so much cleaner and so much more = sophisticated than Struts'. Consider the choice between Controller, = CommandController, and FormController, or the flexibility of = HandlerMapping and ViewResolver. Due to the latter interfaces, you don't = need to explictly map something in a config file that you don't want to = - simply use an implicit mapping strategy like BeanNameUrlHandlerMapping = or InternalResourceViewResolver, or implement your own. And we haven't = even talked about validation, or retrieval and configuration of business = logic services yet. In the end, I guess I'm simply a fan... ;-) Regards, Juergen DI J=FCrgen H=F6ller Senior System Architect __________________________________ werk3ATS - division systementwicklung part of werk3AT internetmedien oeg europaplatz 4 A - 4020 linz t. +43 (0) 732 71 65 29 f. +43 (0) 732 71 65 29 3 jue...@we... www.werk3at.com __________________________________ werk3ATS - WIR ENTWICKELN ERFOLG |