Plugin Pattern

  1. Motivation
    1. To Links classes during configuration rather than compilation.
  2. Summary
    1. This is an Extensibility Pattern implement Runtime loading and extension of application behaviors and features by loading some of application classes dynamically based on configuration supplied.
    2. It can also be used to implement application that runs on different run time where implementation is environment dependent.
    3. The Plug-in pattern extends the behavior of an existing class so that it can be used for a more specific purpose. It differs from using class inheritance, where behavior is altered or overwritten, or configuration, where behavior modification is limited to the capabilities of the defined configuration options.
  3. When to Use
    1. Use Plugin whenever you have behaviors that require different implementations based on runtime environment.
  4. Example 
    1. Application Plug-In like Theams 
    2. Syntax coloring.
  5. Related Patterns
    1. Separated Interface :is use to define the behaviors that will have different implementations based on runtime environment. 
    2. Factory (Plugin Factory) : can be used for special object creations process.
    3. IOC: Can be use for dynamic configuration handling.
  6. Related Technologies 
    1. Enterprise Unity Library Application Block: is used to support IOC i.e. dynamic configuration handling.
    2. Microsoft Addin Framework (MAF) : Microsoft way to build plug-ins for real time applications
    3. Microsoft Extension Framework (MEF) : Framework to support dynamic object loading in declarative way.
  7. References
    1. Overview Tutorials
    2. Further References