用了一天多的時(shí)間,把川波從杭州帶回來的
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
內(nèi)部應(yīng)該是緊耦合的。這和面向?qū)ο蟪绦蛟O(shè)計(jì)的原則相似。一個(gè)類的內(nèi)部(特別是
private
)成員和方法應(yīng)該是邏輯上緊密相連的,而暴露給外部的接口則應(yīng)該是高度抽象的。這個(gè)類和其他類的具體實(shí)現(xiàn)之間的關(guān)系應(yīng)該是松散的。
?
其次是
Standard
和
Internet
。
Service
的目的應(yīng)該是為了隱藏不同系統(tǒng)的異構(gòu)性,所以通過
Internet
的訪問方式必須是標(biāo)準(zhǔn)化的,這樣才有利于
Service
理念的推廣。我所知道的只有
Web Service
的那些協(xié)議:
SOAP, WSDL, UDDI…
貌似
IBM
還在推廣它自己的一些協(xié)議,忘記叫什么啦,大家補(bǔ)充哦。
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
這個(gè)就更技術(shù)化啦。首先,它已經(jīng)默認(rèn)
XML
將是數(shù)據(jù)交換的格式和協(xié)議了(
XML
的力量真是無限大,只不過困惑如果是海量數(shù)據(jù)傳輸?shù)脑挘?/span>
XML
怎么搞)。
?
Interaction
是必然的,在后面我們肯定會(huì)用到定義一個(gè)
Service Component
里有
import
和
export
,這些都是
Service Component
和外部的交互。順便說一句,
Service Component
是通過
Interface
和
Reference
與外部打交道,也許這也體現(xiàn)了松耦合的原則。
?
Message
應(yīng)該是
Interaction
的載體吧。
SOA
里有
SDO
和
BO
的概念,就是在組件與組件交互時(shí)的數(shù)據(jù)流,
WPS
里應(yīng)該有詳細(xì)的實(shí)現(xiàn)支持,值得好好研究。
?
Defined and described
是描述
Service
的利器了,我猜想應(yīng)該是
WSDL
或者是它的擴(kuò)展吧。看到一句說
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)?
?
拿它做關(guān)鍵字可能重要的是說
SOA
和傳統(tǒng)的編程模型有所不同,描述和定義是其中很重要的內(nèi)容。就像如果我們沒有合適的
IDE
,自己用
Java
搞個(gè)
Web Service
就會(huì)很郁悶了。
?
就寫這點(diǎn)啦,大家積極發(fā)揮!