2007年2月28日 星期三
Web Services best practices
承續上篇關於WebServices的錯誤應用說明後 ,
來介紹一下Web Services best practices
以下內容出自 IBM Redbook : sg247257.pdf
Web Services Handbook for WebSphere Application Server Version 6.1
內容的Page.228(AdobeReader頁碼)
Page.198(PDF頁碼)
提到關於~Generic best practices~
(1)Be WS-I compliant
(2)Use simple data types
(3)Avoid nillable primitives
(4)Avoid fine-grained Web services
(5)Avoid Web services for intra-application communication
(6)Use short attribute, property, and tag names
(7)Avoid deep nesting of XML structures
(8)Apply common sense (also known as being defensive)
第1點是要符合WS-I的標準
第2點是要使用簡單資料型別(就是一般的基本資料型別)
裡面的第4點提到 fine-grained 一般是直譯為"細粒" , 就是說到要避免過細的WebServices的使用
另外如(6)(7)就是關於XML傳輸的資料量的問題 , 太長的attributes , property , 太深的XML結構都會造成XML 資料量變大 , 而可能導致佔用大量的網路頻寬
此外還有(5)提到避免用於intra的應用程式的通訊 ,這點也說明了 , 不要濫用WebServices於系統的建議
世上沒有萬靈藥 , 沒有一種藥可以治療所有的各種病痛
技術與樣式也是一樣 , 需要看場合 , 看需要的應用 , 濫用技術與樣式不是好事
提出此篇來與前一篇 WebServices的錯誤應用來對照呼應
有興趣看完原文的人 , 可上 IBM 的紅皮書網站 , 下載上面提到的 PDF , 來看詳細內容
訂閱:
文章 (Atom)