用了一天多的時間,把川波從杭州帶回來的 PPT 大概地掃了一下。小寫一篇拋磚引玉 ^_^
Service 并不一定是 Web Service ,它的定義更加寬泛。在 PPT 里找到兩種小分析一把:
l???????? Gartner definition: Loosely coupled software components that interact with one another dynamically via standard Internet technologies
l???????? Keyword: Loosely coupled; Standard; Internet
也就是說 Service 首先要是松耦合的,而我想 Service 內部應該是緊耦合的。這和面向對象程序設計的原則相似。一個類的內部(特別是 private )成員和方法應該是邏輯上緊密相連的,而暴露給外部的接口則應該是高度抽象的。這個類和其他類的具體實現之間的關系應該是松散的。
?
其次是 Standard 和 Internet 。 Service 的目的應該是為了隱藏不同系統的異構性,所以通過 Internet 的訪問方式必須是標準化的,這樣才有利于 Service 理念的推廣。我所知道的只有 Web Service 的那些協議: SOAP, WSDL, UDDI… 貌似 IBM 還在推廣它自己的一些協議,忘記叫什么啦,大家補充哦。
l???????? W3C definition: A software application identified by a URI, whose interfaces and binding are capable of being defined, described, and discovered by XML artifacts and supports direct interactions with other software applications using XML-based messages via Internet-based protocols
l???????? Keyword: XML, Interactions, Messages, Defined and described
這個就更技術化啦。首先,它已經默認 XML 將是數據交換的格式和協議了( XML 的力量真是無限大,只不過困惑如果是海量數據傳輸的話, XML 怎么搞)。
?
Interaction 是必然的,在后面我們肯定會用到定義一個 Service Component 里有 import 和 export ,這些都是 Service Component 和外部的交互。順便說一句, Service Component 是通過 Interface 和 Reference 與外部打交道,也許這也體現了松耦合的原則。
?
Message 應該是 Interaction 的載體吧。 SOA 里有 SDO 和 BO 的概念,就是在組件與組件交互時的數據流, WPS 里應該有詳細的實現支持,值得好好研究。
?
Defined and described 是描述 Service 的利器了,我猜想應該是 WSDL 或者是它的擴展吧。看到一句說 WSDL 作用的話覺得蠻精彩的。 WSDL provides a notation to answer the following questions:
1. What (is this service about)?
2. Where (does it reside)?
3. How (can it be invoked)?
?
拿它做關鍵字可能重要的是說 SOA 和傳統的編程模型有所不同,描述和定義是其中很重要的內容。就像如果我們沒有合適的 IDE ,自己用 Java 搞個 Web Service 就會很郁悶了。
?