组合型智能客户端应用-caoyanming_第1页
组合型智能客户端应用-caoyanming_第2页
组合型智能客户端应用-caoyanming_第3页
组合型智能客户端应用-caoyanming_第4页
组合型智能客户端应用-caoyanming_第5页
已阅读5页,还剩30页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

组合型智能客户端应用

WithCompositeApplicationBlock.NET架构顾问

微软(中国)日程组合型应用的应用场景CompositeAppBlock体系架构概述CompositeAppBlock主要概念DemoJPMC–网上银行

集成投资信息集成分析工具集成新闻及提醒集成股票数据

Citibank–信息发布门户Thomson–金融数据门户Dell–客服集成桌面CommonwealthBankofAustralia–柜员系统CommonwealthBankofAustralia–柜员系统ClienttierCommonwealth柜员系统体系结构DatastoragePrivateServicesSmartPartActiveDirectoryLocalCacheAgentSecurityInstrumentationOracleConfigurationAuthnOrchestrationPrivateservicenPrivateserviceAuthzConfigLegacysystemsMainframenWSProxyIFWServicenSOFAServiceHelpersDataIntegrationSOFAMainframeIFWServiceDatacentreBranchsiteSmartClientSmartCardLocalADSOFAFarmHISFarmADFarmBizTalkFarmMainframeOtherApplicationServers,OracleEveryServiceauthorizedagainstADCommonwealth柜员系统部署方案日程组合型应用的应用场景CompositeAppBlock体系架构概述CompositeAppBlock主要概念DemoBillingInventoryCRMSmartClientModule组合型

解决方案将不同的功能模块组合成解决方案运行环境提供基础服务降低开发成本灵活方便什么是组合型智能客户端应用?SmartClientModuleSmartClientModuleCompositeUIAppBlock的来由UIP1PAGUIP2PAGCABPAGCCFThomsonDellCAB微软其他部门客户解决方案PAG[Otherfieldframeworks]…CompositeUIApplicationBlock

创建企业级智能客户端对系统设计团队的价值:质量与一致性提供一个针对企业级智能客户端应用的公共开发体系结构提供一个一致的和可预测的方法来开发、包装、发布基础组件,以便强制企业应用的体系结构标准对开发团队的价值:生产力提供一个开发环境能很好的隐藏复杂度和提高生产力通过高度抽象和关注点的分离,开发人员能够关注于业务逻辑提高基础框架代码的复用商务目标:提高最终用户的生产力和业务工作的敏捷性公司可以以更敏捷的方式推出新的和升级的功能界面使最终用户更快的、更准确的完成工作任务,避免通过Alt-Tab,Copy-Paste的方式作应用间的数据交换一致的界面降低了培训费用主要困难将完全不同的组件组合成一个完整的应用将Shell部分与应用逻辑部分分离开来可扩展性使您能使用自己的设计模式和开发方法ShellCompositeAppBlock概述<ModuleCatalog>ModuleUIElementMgrViewUIElementMgrViewElementElementApplicationHostWorkItemSharedStateSharedEventsCAB体系结构ShellHostUserInterfaceElementsSmartPartManagers&BaseClassesHostedControlLayoutMDIStatusStripUIElementMenuStripUIElementToolStripUIElementServicesCatalogReaderLoaderAuthentication[Logging?]Module1SmartPart1Controller1SharedStateModule2SharedStateSmartPartXControllerXSmartPartYControllerYMainFormInitializer[Authorization?]BizLogic开发Infrastructure开发Shell开发AWorkItem设计组合型应用–应用逻辑将views(SmartPart)设计为独立于controllers的单元共享模块状态共享基础服务封装用例-重用降低模块间的依赖性尽量使用events,services,andinterfacesSmartPartAControllerASmartPartBControllerBBusinessEntitiesBusinessEntitiesService1AWorkItem设计组合型应用–界面逻辑SmartParts是控件–Workspaces在一个可视框架中显示它们Shell开发人员开发Workspaces.控件跟Workspaces无关界面元素可以用共同的方法添加以免业务逻辑开发人员把业务逻辑跟特定的界面风格紧耦合可以集中控制用例改变界面的方式和时间Commands连接了可操作界面元素集和一个业务逻辑callbackViewAControllerAViewBControllerBBusinessEntitiesBusinessEntitiesShellUIElemMgr1UIElemMgr2Element1Element2UIInitCommandCommandWindowsWorkspaceTabWorkspace应用启动次序:1of2

初始化Shell,Host,和初始服务Shell启动Shell给HostFactory

提供基本的启动设置HostFactory

根据这些设置创建Authentication,CatalogReader,Initializer

和Loader服务的实例HostFactory

创建Host并把这些服务添加给HostHostShellHostFactoryBootstrapConfigDataLoader123AuthenticationInitializer45CatalogReader应用启动次序:2of2

初始化Host并加载ModulesShell调用Host.Initialize(),这个由

Initializer

服务实现Host调用Authentication服务,该服务负责在当前应用程序域中建立principalCatalogReader

服务以SolutionProfile返回基本模块设置。CatalogReader

服务封装了如何选择正确的SolutionProfile以加载正确的SmartPartsLoader被调用并赋予SolutionProfile,开始以正确的次序加载modules(带有依赖性的属性)Loader调用module的入口类的AddServices()方法,让module注册自己的服务然后调用Start()方法HostShellLoader1AuthenticationCatalogReaderMyModuleIPrincipal2HostInitializationSolution

Profile34IModuleLoadAssemblyLoadIModuleServiceXYZ5-AddServices

-StartInitializerComponents,Services&ContainersCAB所有的部分都是围绕着

containers,componentsandservices这三个概念构建的采用这个体系结构,你可以对CAB的功能进行任意的扩展Components是包含一些逻辑的对象。比如,WindowsControls,controllers带有业务逻辑和服务代理Services是被应用中许多components调用的对象。比如securityservices,tracingservices,eventingservicesContainers是components和services的集合。Container管理其中的components的生命周期。.Component可以向container请求一个service。Containers可以包含其他的containers。ApplicationHostDefaultWorkItemChildWorkItem1ChildWorkItem2Service1Service2Component1Component2Component3Component4Component5Service3添加和定位服务

使用ServiceLocator和Injection模式AddingServicesCABFoundationServicesModule-addedservicesProgrammaticallyDeclarativelyAcquiringServicesFindinupstreamcontainersProgrammaticallyDeclarativelyApplicationHostAWorkItemModuleLoaderModule[Service(typeof(IMyService))]publicclassMyService:IMyService

{

}IMyServiceMyServiceViewControllerpublicclassMyComponent{[ServiceDependency]IMyServicemyService;

}日程组合型应用的应用场景CompositeAppBlock体系架构概述CompositeAppBlock主要概念DemoShellUIElements:你可以改变的shell中的共享元素菜单条,状态条,splashscreens,etcWorkspaces:能够显示和隐藏控件的对象Tabbed,Zoned/“Portal”,MDI,Windows,Decked…Commands:可以映射到多个界面元素的“行动”比如“显示客户明细”命令有工具条项和菜单项UIElementsShell开发人员创建Shell

应用程序添加UIElementManagers注册

WorkspacesPart开发人员创建控件(SmartParts)定义

Commands映射UIElements

到Commands显示

Controls

在Workspaces

里WorkspacesWorkspaces可以一致的显示多个控件Shell开发人员创建定制的workspaces以提供:控件周围相似的框架和修饰共享的布局和定位眩目的切换ActivationUIs(tabs,Alt-Tabkeystrokes,etc)提供:TabbedWorkspaceWindowsWorkspaceDeckedWorkspaceSmartPart开发人员可以创建独立于Workspace的PartsTabbedWorkspaceASmartPartYourWorkItemWindowsWorkspaceSplatWorkspaceaWorkspace.Show(mySmartPart);ViewAWorkItemStateWorkItemsWorkItem代表一个用例包含在Workspace之中服务ServiceAgents并加载状态(同步或异步)创建其他组件(比如Views)。CAB创建Controllers。组件共享WorkItemState并可以通过它控制用例的生命周期YourWorkItemRun(IWorkspacews)ServiceAgentServiceAgentBusinessEntitiesBusinessEntitiesControllerAEventTopictopic://Customer/ChangedEventBroker–Publisher-SubscriberPublishersSubscribers1*.NETEventwithAttributeEventCatalogService.NETmethodwithattribute[EventSubscription(“topic://Customer/Changed”,ThreadOption.Background)]PublicvoidCustomerChanged(objectsender,CustArgsargs){//gocallsomewebservicesorsomethinglong-running}[EventPublication(“topic://Customer/Changed”)]eventEventHandler<CustArgs>CustomerIdChanged;//firelikeanormal.NETeventCustomerIdChanged(this,newCustArgs(…)

);[EventSubscription(“topic://Customer/Changed”)]PublicvoidCustomerChanged(objectsender,CustArgsargs){MessageBox.Show(args.CustomerId,“newcustomer!”);}Publishers和Subscribers对以下达成一致:主题(由URI决定)消息(如果需要一个特定的EventArgs)范畴(全局事件还是局部事件)Subscribers被调用时有对该线程的控制Background(Forlong-runningwork)UIThread(toupdateUIcontrolsonappropriatethread)Publisher(onsamethreadaspublisher)AWorkItem共享WorkItemState弱类型的(useasadictionary)或是强类型的(wrapanitemwithget/set)取决于您希望的耦合度要多少调用State:动态编程访问,或者通过IoCattributespublicvoidSomeMethod(){CustomercurrentCust=(Customer)Context.State[”Customer”];}publicclassControllerX:Component(privateCustomercust;[State(“Customer”)]publicCustomer{set{cust=value;}})ViewXControllerXWorkItemStateBusinessEntitiesBusinessEntities状态保持(StatePersistence)提供一个简单的服务的方式来存储和加载WorkItemstate本质上是对WorkItem(是一个applicationcontroller)使用了memento

模式,采用一个State对象,并提供一个

service,这个service作为这个State对象的repository。提供的实现包括:SQLIsolatedFileFileOptionalDPAPI加密publicinterfaceIStatePersistenceService{voidSave(Statestate);StateLoad(Guidid);voidRemove(Guidid);}//yourWorkItem[ServiceDependency]publicIStatePersistenceServicepersistence;publicvoidSomeMethod(){persistence.Save(this.State);}DemoCAB设计中所采用的几种模式Implementpattern…By…ModelViewController

Usingthe

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论