1.Front Controller Listens for User Gestures
前端的控件監(jiān)聽用戶的行為。注意它只是監(jiān)聽,并不會做任何反應(yīng)。
2.Commands Do All the Work
控件監(jiān)聽以后調(diào)用Commands來做相應(yīng)的事情,Command做了所有工作。
3.Delegate Server-Side Business Logic to Business Delegates
把服務(wù)器端的業(yè)務(wù)邏輯委托到 Bussiness Delegates中。因為很多時候command需要獲得服務(wù)器端數(shù)據(jù),所以這樣一來它可以直接調(diào)用Bussiness Delegates而不用關(guān)注如何連接數(shù)據(jù)的細(xì)節(jié),實現(xiàn)了信息隱藏。
4.Business Delegate Finds Services with the Service Locator
Command調(diào)用Business Delegate 后,Business Delegate 通過Service Locator來找到相應(yīng)的RPC services,然后執(zhí)行實現(xiàn)從服務(wù)器端取數(shù)據(jù)。
5.Transfer Data as Value Objects
把傳輸過來的數(shù)據(jù)存儲為Value Objects。這點大家應(yīng)該都很熟悉,比如想要查詢一個公告,就必定創(chuàng)建一個公告類,來存儲每一個公告的標(biāo)題等信息。
6.Store State in the Model Locator and Let Model Notify View
在Model Locator 保存狀態(tài)并且能使Model檢測到View的變化。這樣一來用戶操作就能直接影響Model,比如添加物品到購物車,Model中的購物商品就會自動增加。