新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> Web服务(Web Services,WS), 语义Web服务(Semantic Web Services, SWS)讨论区: WSDL, SOAP, UDDI, DAML-S, OWL-S, SWSF, SWSL, WSMO, WSML,BPEL, BPEL4WS, WSFL, WS-*,REST, PSL, Pi-calculus(Pi演算), Petri-net,WSRF,
    [返回] 中文XML论坛 - 专业的XML技术讨论区W3CHINA.ORG讨论区 - Web新技术讨论『 Web Services & Semantic Web Services 』 → [推荐]REST recommended for Web services coders 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4146 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: [推荐]REST recommended for Web services coders 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     admin 帅哥哟,离线,有人找我吗?
      
      
      
      威望:9
      头衔:W3China站长
      等级:计算机硕士学位(管理员)
      文章:5255
      积分:18406
      门派:W3CHINA.ORG
      注册:2003/10/5

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给admin发送一个短消息 把admin加入好友 查看admin的个人资料 搜索admin在『 Web Services & Semantic Web Services 』的所有贴子 点击这里发送电邮给admin  访问admin的主页 引用回复这个贴子 回复这个贴子 查看admin的博客楼主
    发贴心情 [推荐]REST recommended for Web services coders

    http://searchwebservices.techtarget.com/qna/0,289202,sid26_gci1210693,00.html

    REST recommended for Web services coders

    By Rich Seeley, News Writer
    15 Aug 2006 | SearchWebServices.com  

    Representational State Transfer (REST) is the ideal strategy for developing Web services, especially using Ruby on Rails, says author and consultant Bruce Tate.

    [B]

    Bruce Tate is an author and independent consultant in Austin, Texas, and an advocate of lightweight development with Ruby on Rails. Having worked for 13 years at IBM, in roles ranging from a database systems programmer to Java consultant, he contributes articles to the IBM DeveloperWorks Web site. We talked to him about his enthusiasm for building Web services with REST and, of course, Ruby on Rails.

    For those who may not be familiar with [URL=http://searchwebservices.techtarget.com/sDefinition/0,290660,sid26_gci823682,00.html]Representational State Transfer[/URL] (REST) can you give us an overview of it?[/B]
    Bruce Tate: REST is essentially from a dissertation by Roy Fielding. For a dissertation topic, he chose to write about Web architecture models. He looked at the way people solve traditional Web services problems because the Web was around a long time before any of the WS-* specifications. He found a pattern where programmers would use existing standards to effectively handle Web services requests. If you think about it, the whole Web is a bunch of little Web services and these Web services basically serve content. The way that we use them is we access named resources. We use the HTTP protocol, and we get a structured response back. So if you bend your brain a little bit, think of HTML as a more specific XML. If you think about Web services in that vein, it's just an HTTP request to a named resource, and XML comes back. This opens up a whole new way of thinking about services. A REST-Web service is basically a simplified model where everything is wrapped around the HTTP send/receive protocol.


    So where did the concept of REST come in?
    Tate: You can think of Amazon as a database itself. You can do things like an HTTP "get" and then you can pass "/book" and an ID of a book, and get a single book back. Or you can do HTTP post and then pass the form with all the particulars about a book to update it. There's an HTTP verb called "delete" to delete things and an HTTP verb "put" that will let you insert things. So you have all your CRUD methods: create, read, update, delete. That's REST. That's really all there is to it.


    Is it the simplicity of REST that makes it so attractive?
    Tate: Yes. It's simple. It does most of what you need it to do. It has a security model built in, secure sockets. It has a network structure built in because you can put a link to a net resource in a document. So you can do composition that way. You can have a list of books, and they can have links to books or they can be links to other lists of books. REST changes the way you think about how you structure applications. You're mimicking the Internet instead of trying to decide what a method is. That model is just very, very effective.


    Why should developers look to REST as a model for building Web services?
    Tate: It's a nice well-understood model. We know it. We've used it for 15 years as the Web. The Web is one big fat REST implementation. Anybody who has been doing e-commerce -– eBay or Yahoo! or any of those types of services –- they use REST. If you need more information, you embed the request parameters into the URL. It's easy to do.


    What would be your recommendations for developers looking at REST for Web services development?
    Tate: Developers looking at Web services should look at REST first. I have a strong philosophy that you should pick the simplest approach that works and only go away from that when it breaks, when it fails. The REST model really hasn't failed. It really doesn't fail for 80 to 90 percent of what we want to do. And all the complexity in the WS-* specifications goes to serve the 5 or 10 percent of the most complex implementations.


    What about that other 10 percent?
    Tate: If you think of what you would integrate with WS-* Web services, the IBM and Microsoft model, is basically for integrating big vendors and that's it. To get those vendors' platforms to talk to each other, they have to be on the same API. Since there are so many APIs and so little testing across vendors, the integration experience is absolutely horrendous for anything beyond the most basic integration, or the best-traveled roads.


    So are you saying REST is an alternative to either the WebSphere approach or the .NET approach?
    Tate: Yes. You can use REST with WebSphere, .NET or WebLogic. If you're talking about, "How do I implement a REST server with Java?" you implement a servlet and pass XML back and forth. Java developers know how to do that. They've known how to do that for years.


    How about in the .NET world?
    Tate: You implement their servlet equivalent, which is ASP in some cases or other APIs.


    So are you saying REST can work with WebSphere or .NET, but it's an easier alternative for developing Web services?
    Tate: Absolutely.


    Where does Ruby fit in with REST?
    Tate: Specifically Ruby on Rails has a very clean, very productive approach for building REST-based Web services. I would say you can do it with a quarter of the effort of a traditional Java Web service.


    Beyond productivity are there other advantages to building REST Web services using Ruby on Rails?

    Tate: Another advantage is that Ruby on Rails is an exploding platform. Ruby on Rails applications need to talk to other languages and other technologies and REST is a good way to get there.


    Is there anything else we need to know about building REST Web services with Ruby on Rails?
    Tate: There's one more thing that you need to know. There's another model being built into Rails that's called SimplyRestful. David Heinemeier-Hannson, the founder of Rails, has outlined an approach to make REST even simpler on Rails. That means the Rails Web services support is about to get better. And second, there's going to be a major re-work of Rails Web services in the next release. That's very different from the Java approach where you try to maintain backward compatibility at all costs. It's going to leave some Rails customers out in the cold. But it's also going to provide a path for them to migrate. More importantly, it will let the Ruby on Rails platform continue to improve rapidly. That's a nice counterpoint if you're looking at how .NET and Java grow versus Rails. As Rails grows it isn't bloating as quickly because they are not afraid to take things out of the language that aren't a perfect fit.


    Is there a timeframe for SimplyRestful?
    Tate: It will be in Rails 1.2 and we're talking months rather than years.

    For more information
    [URL=http://searchwebservices.techtarget.com/tip/0,289483,sid26_gci1199369,00.html]REST and Web services: The ZapThink take[/URL]

    [URL=http://searchwebservices.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid26_gci1189497,00.html]What are the benefits and limitations of building services with REST?[/URL]


       收藏   分享  
    顶(0)
      




    ----------------------------------------------

    -----------------------------------------------

    第十二章第一节《用ROR创建面向资源的服务》
    第十二章第二节《用Restlet创建面向资源的服务》
    第三章《REST式服务有什么不同》
    InfoQ SOA首席编辑胡键评《RESTful Web Services中文版》
    [InfoQ文章]解答有关REST的十点疑惑

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/8/17 16:27:00
     
     poseidonli 帅哥哟,离线,有人找我吗?
      
      
      等级:大二(研究C++)
      文章:18
      积分:207
      门派:XML.ORG.CN
      注册:2006/11/28

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给poseidonli发送一个短消息 把poseidonli加入好友 查看poseidonli的个人资料 搜索poseidonli在『 Web Services & Semantic Web Services 』的所有贴子 引用回复这个贴子 回复这个贴子 查看poseidonli的博客2
    发贴心情 
    不错  谢谢!
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/11/28 21:30:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 Web Services & Semantic Web Services 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/16 15:52:06

    本主题贴数2,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    3,859.375ms