Cairngorm 是一个轻量级的Flex RIA程序开发框架,主要就是对开发Flex应用程序应用了一系列的设计模式,从而使开发出来Flex程序可扩展性,可维护性都大大提高。
Cairngorm 主要分为ModelLocator (存值),view(一些flex组件button,panel之类) ,frontController(接受evetnts),command(处理业务逻辑,调用delegate或者其它commands),delegete(远程调用实例化),service。
cairgorm的工作流程是:客户端由view组成,view由于用户鼠标产生的event被controller广播并监听, front controller会将event映射到command,comand创建delegete,然后更新modle locator中的数据。。。yeah!终于有那么一点点了解了。。。
刚刚看了flex项目代码的框架,果然是按照这个设计模式构造的。。。model在model文件夹,view在view文件夹,controller在controls文件夹, command做commands文件夹,delegate在business文件夹。
举例说明:
model:CreateData.as
view: 一些控件
control: createDataEvent.as
Commands: createDataCommand.as
Delegate:DlegateBase.cs delegate就是用来调用service的,所以如果只需要调用一个service,只需要一个delgete。
看起来这个框架还蛮容易理解的耶,嘻嘻:)