《Prism 5.0源码走读》 设计模式

Prism或Prism构建的应用程序时会使用大量的设计模式,本文简要列举Prism相关的那些设计模式。

  • Adapter(适配器模式):Prism Library主要在Region和IoC container应用Adapter模式。
    1. ContentControlRegionAdapter.cs
    2. ItemsControlRegionAdapter.cs
    3. SelectorRegionAdapter.cs
    4. UnityServiceLocatorAdapter.cs
    5. MefServiceLocatorAdapter.cs
  • Application Controller Pattern: 这个我们在应用程序中经常应用于控制View切换和跳转,减少event的数量。
  • Factory Pattern: Prism里面使用工厂模式来创建Region behavior.
  1. RegionBehaviorFactory.cs
  • Command Pattern:
  • Dependency Injection Pattern:
  • Event Aggregator Pattern:
  • Facada Pattern:
  • Inversion of Control Pattern:
  • Observer Pattern:
  • Model-View-ViewModel Pattern:
  • Registry Pattern:
  • Service Locator Pattern:
  • Separated Interface and Plug-in
  • Composite and Composite View

下图是设计模式在Prism结构设计中的应用:

编辑记录:

2014.08.11 初始版本

2014.08.12 加入Factory Pattern

原文地址:https://www.cnblogs.com/codesee/p/3905792.html