以前我对JSR 311(Java API for RESTful Web Services)抱有很高的期待,但是最近看到的一些消息让我对这个标准的前景很不乐观。
去年11月著名的Java Network Programming的作者Elliotte Rusty Harold说:
http://webservices.ctocio.com.cn/comment/127/7648127.shtml
JSR 311应该更名为“Java HTTP服务器应用程序接口”。
今年2月中旬Elliotte再次发表观点炮轰JSR 311:
http://tech.groups.yahoo.com/group/rest-discuss/message/7830
Sun proposes to apply Web service standardization principles to REST
BabelFish blog的作者Henry Story写了一篇关于这件事情更加全面的报道:
http://blogs.sun.com/bblfish/entry/jsr_311_a_java_api
Elliotte说:
They also seem to believe that "building RESTful Web services using
the Java Platform is significantly more complex than building SOAP-
based services". I don't know that this is false, but if it's true
it's only because Sun's HTTP API were designed by architecture
astronauts who didn't actually understand HTTP. This proposal does not
seem to be addressing the need for a decent HTTP API on either the
client or server side that actually follows RESTful principles instead
of fighting against them.
所谓的“不懂HTTP的太空人架构师”搞出来的Sun的HTTP API是什么呢?很明显指的是Sun的Servlet API。新的REST API
如果要与Servlet API兼容,需要付出非常大的代价。这正是RESTlet决定抛开Servlet API自己搞一套API的原因。
JSR 311不仅要与Servlet API兼容,看来还准备采用基于SOAP的协议栈(JAX-RPC、JAX-WS,etc.)来实现
REST:
Remember, these are the same jokers who gave us servlets and the
URLConnection class as well as gems like JAX-RPC and JAX-WS. They
still seem to believe that these are actually good specs, and they are
proposing to tunnel REST services through JAX-WS (Java API for XML Web
Services) endpoints.
即使他们并不是采用基于SOAP的协议栈来实现REST,他们对JSR 311的设计也会与基于SOAP的协议栈很相似。
他们这样做的背景是JSR 311的领导Marc Hadley正是多年前制订基于SOAP的那些协议栈的领导:
To give you an idea of the background we're dealing with here, one of
the two people who wrote the proposal "represents Sun on the W3C XML
Protocol and W3C WS-Addressing working groups where he is co-editor of
the SOAP 1.2 and WS-Addressing 1.0 specifications. Marc was co-
specification lead for JAX-WS 2.0 (the Java API for Web Services)
developed at the JCP and has also served as Sun's technical lead and
alternate board member at the Web Services Interoperability
Organization (WS-I)."
看到这里,我已经被他们的决定惊呆了,我简直无话可说!
REST之父Roy Fielding对JSR 311的误导非常不满,他对Marc Hadley下了重话:
http://tech.groups.yahoo.com/group/rest-discuss/message/7858
Marc, I already explained to Rajiv last November that I would not
allow Sun to go forward with the REST name in the API. It doesn't make
any sense to name one API as the RESTful API for Java, and I simply
cannot allow Sun to claim ownership of the name (which is what the JSR
process does by design). Change the API name to something neutral,
like JAX-RS.
Henry Story问道:
If one were to standardize an api why not standardize the RESTlet API?
这正是我想提出的问题。JSR 311委员会难道变成了一个政治斗争的场所?难道是Sun的几个人完全把持了JSR 311未来的发展方向,使得这个标
准为Sun的利益服务,并且有意排挤来自民间的Jerome Louvel?
如果真的是这样,那么JSR 311邀请Jerome Louvel不过只是为了招安一两个来自民间的专家为他们贴点金而已。Jerome不如退出
JSR 311专家组,潜心发展自己的RESTlet,并且把自己的书写好,让时间和开发者的选择来证明谁对谁错。
dlee最后总结一下:
JSR 311与其搞出来一个基于SOAP的异常复杂的API,还挂羊头卖狗肉地宣称这就是REST,误导广大Java开发者认为REST天生就是很复
杂,应该像躲避瘟疫一样躲避REST,不如不要管这个标准叫做REST,Roy Fielding都不买账了,你们这样继续玩下去也不会有什么好结果
的。
JSR 311落得一地鸡毛的结局当然是谁都不愿意看到的,但是目前看来,这个标准的前景非常不乐观。看来他们又陷入了兼容以前不良设计的标准和委员会
设计的泥潭之中。为什么Sun领导的标准最后总会搞的很复杂而不实用,是老狗学不会新把戏,还是制订标准的规则本身就有问题?为什么很多JCP的标准一
旦有Sun的人插手总是会搞糟?这些是我们需要深入思考的问题。
发表于 @ 2008年03月11日 21:50:00|评论(loading...)|编辑