Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Architecture & Framework » Spring Framework  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:Struts VS Spring Web [Re:tier3]
floater

Java Jedi

总版主


发贴: 3233
积分: 421
于 2004-09-16 01:27 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
1. spring has 1 tag, one interface with one method, while struts has dozens of tags. This is not only an overkill, but also pollute into html world, it increases the learning cost, make html tools hard to use(even dreamweaver adopts this).
2. struts actionforms are intrusive to business objects, they have their own hirachy so we can't have our own hirachy in the business layer. DynaForm has its own problem too, there are redundent small objects everywhere.
3. M in MVC is for model, but the datasource binding in struts makes us to carry this unrelevent object all the way through. Business objects shouldn't care this at all. Struts folks misunderstand this.
4. Struts IoC is not generic at all.

These are just behaviors on the surface(It's just hard to capture all the behaviors because they are changing). There are some fundamental difference on concepts and logic in understand web problems:
1. The dynamic data and structure in HTML: are handled by JSTL, no extra tags needed. Error binding shouldn't interfere with HTML code. Replacing html with customized tags is pretty much like stepping on someone else's toes.
2. The mismatch between HTML form and java OO. All we really need is to match HTML form to java objects. This can be handled by one tag, that's enough, no need for more than 1. Spring does this precisely, while Struts just uses brutal force for almost everything(it has 41,000 lines of source code for tags). It further replaces the form action too.

So we really need just one simple tag for binding and errors. Once we have the java object for the form, we should be back to OO world and do whatever we do there. It should be a simple solution, conceptually. Struts just makes it a big deal, even struts centered solution. It claims that it solves certain problems, but the facts are it solves them with a higher price tag.

Recently, it happened I was dragged by my bosses into this Struts/Spring war. I found most of the struts developers I talked with are not technical matured, short sighted, narrow minded. They just know how to code mechnically, and don't have extensive experience. So I figured this is not just Struts/Spring war, but a war or a coaching on OO and general computer science. This is where I stopped because I don't get paid for this.



"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler, Refactoring - Improving the Design of Existing Code

话题树型展开
人气 标题 作者 字数 发贴时间
23171 Struts VS Spring Web tier3 284 2004-09-15 19:52
21557 Re:Struts VS Spring Web tier3 202 2004-09-15 19:54
22389 Re:Struts VS Spring Web floater 2300 2004-09-16 01:27
21545 Re:Struts VS Spring Web tier3 769 2004-09-16 09:17
21322 Re:Struts VS Spring Web floater 207 2004-09-16 22:30
21154 Re:Struts VS Spring Web bill1 28 2004-09-29 08:32
21658 Re:Struts VS Spring Web sunfmin 4558 2004-12-24 16:24
21111 Re:Struts VS Spring Web floater 121 2004-12-24 21:37
21310 Re:Struts VS Spring Web dawnlong2000 856 2005-01-11 21:47
21651 Re:Struts VS Spring Web floater 124 2005-01-11 23:04

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923