Monday, January 14, 2008

Plugin architecture 1- overview

Keywords: C#, Plugin architecture


Many tools provide plugin architeture, such as Eclipse, NotePad++. The plugin mechanism will enhance the host application greatly.


The plugins are always located in other assmemblies other than the host application. You can enhance your applicaiton even though the host applicaiton was changed if you have used the plugin architecture. To help conceptualize the communication that occurs between a host application and a plug-in, the Strategy design pattern can be applied.


The gist of the Strategy design pattern is to decouple the functionality of a solution from its container. This decoupling is achieved by separating the implementation of the host application and the things it must do into strategies. Communication between the host application and its strategies is then done through a well-defined interface. This separation provides two immediate benefits. First, anytime a software project can be broken down into smaller discrete units, it is a bonus to the engineering process. Smaller code pieces are easier to build and maintain. The second benefit is the ability to switch strategies without affecting the operation of the host application. The host application is not concerned with specific strategies, just the common mechanism to communicate with the strategies.


Plugins: PluginA(In AssemblyA) , PluginB1(In AssemblyB), PluginB2(in AssemblyB)

One C# project based plugin arch, download 7zip format source

No comments: