RESTful Web Services Part 5 - Relevant Concepts

来源:互联网 发布:linux 修改用户权限 编辑:程序博客网 时间:2024/05/12 12:24
Identifying RESTful Services
  • Use URIs to differentiate between representations
  • Expose only publishing verbs
  • Provide access to binary content,XML instances and collections
  • Use query parameters to filter items from a collection
  • Representations may be data,presentation, state or all three.

The Importance of Collections – Collections are more important to REST than many be obvious:
  • A collection is a set of related resources
  • A collection is also a resource –it has an address, has one or more representations, is discrete and so forth
  • Files in a folder may be a collection, but collections are more inclusive, and can include database records, devices and so forth.

REST and Databases

    In essence, a RESTful approach uses a similar metaphor to the CRUD (Create, Read, Update, Delete) methods that a database uses, in the form (Post, Get, Put, Delete). Because of this, one way of summarizing RESTful services is that it is a way to treat the Web as a database.

    If the web is becoming a database, then XQuery will very likely end up becoming its global query language. Developed as part of the W3C core services,X Query uses XML as an abstraction layer for working with data repositories,though neither the source nor the output of such a query needs in fact to be XML itself. X Query would be the next stage of data abstraction.

0 0
原创粉丝点击