2010年7月10日 星期六

[www]什麼是 REST ?

這一篇算是一個研究心得,寫來自己備忘用的。

REST 不是 take a rest 的意思。他來自於 Representational State Transfer 的縮寫。然而,這又是什麼意思呢?

大多數的說明,都說 REST 是一種風格,一種軟體架構的風格,一種適合分散超媒體系統的軟體架構風格。分散超媒體的原文是(distributed hypermedia),最常舉例的標準範例系統就是 World Wide Web。

REST 風格的架構,由許多 client,及許多 server 組合而成的。講到 client/server 架構的話,就是由 client 主動送出 request,而 server 送回 response。這個是目前大家認同的模式,若要求 server 送 request 而 client 送回 response,就不屬於這個定義了。Requests 及 Responses 來回傳送的目的,環繞在傳送「資源」的「外在表現」。原文是 Requests and responses are built around the transfer of "representations" of "resources".[參考2] 。資源(resource)基本上是任何有相關有意義需要被注意的概念。而「資源」的「外在表現」(A representation of a resource),基本上是一個代表資源的現在狀態或即將狀態的文件。這一段儘量照翻參考2的文章,對我這個中國人來說很痛苦。不了解的人還是不了解啦。

 

參考:
http://www.infoq.com/articles/rest-introduction
http://en.wikipedia.org/wiki/Representational_State_Transfer
http://tomayko.com/writings/rest-to-my-wife
http://lightyror.thegiive.net/2007/04/rest.html
http://ihower.tw/blog/archives/1542
http://207.22.26.166/bytecols/2001-08-15.html
http://www.xml.com/pub/a/2004/03/17/udell.html
http://zh.wikipedia.org/zh-tw/REST

沒有留言:

張貼留言