(1)CairngormEvent:
繼承flash.events.Event,其包含一個data成員,用來傳遞參數數據之用。
(2)CairngormEventDispatcher:
采用單例模式(Singleton Pattern),用來廣播用戶發起的自定義動作事件。
(3)FrontController:
相當于控制中心,在這里你要做的工作是將事件(CairngormEvent)和命令(Command)之間的映射關系注冊在它的
成員commands(Dictionary類型)中,通過下面的類似方法進行注冊:
addCommand( GetProductsEvent.EVENT_GET_PRODUCTS, GetProductsCommand );
以后,凡是CairngormEventDispatcher廣播出來的事件,首先都會在這里查找,找到對應的event對應的command后,
便執行Command的execute()方法。
FrontController必須要在你的系統中實例化,具體的實例化方法如下:

2

3

4

5

提供了HTTPService、WebSercice、RemoteObject三種RPC服務。使用時候,將需要的RPC服務登記在該接口中,
以mxml形式采用單例模式(Singleton Pattern)實現IServiceLocator,如下面使用例子:

2

3

4

5

6

7

8

9

10

11

12

13

14


2

3

4

5


學習Cairngorm站點、文章收集.
1:http://www.davidtucker.net/category/cairngorm/ 入門強烈推薦
*http://www.cairngormdocs.org/tools/CairngormDiagramExplorer.swf cairngorm圖解法表示
http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm 推薦
2:http://opensource.adobe.com/wiki/display/cairngorm/Developer+Documentation
3:http://www.adobe.com/devnet/flex/articles/graduating_pt1.html
4:http://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html
5:http://jessewarden.com/2007/08/10-tips-for-working-with-cairngorm.html
6:Cairngorm學習——使用WebService和HTTPService服務
7:AIR也可以Cairngorm -- http://www.ericfeminella.com/blog/2007/07/16/air-cairngorm-air-extensions-for-cairngorm/
實例:http://www.duzengqiang.com/blog/article.asp?id=198 Flex Example: HTTPService & Cairngorm 2.2