Thomas Cheah discusses developing a plug-in framework. Plug-ins can extend functionality for applications like Internet Explorer, Microsoft Office, Photoshop, Skype, and WordPress. A plug-in framework loads and initializes plug-ins using a PluginManager that retrieves, executes, and disposes of plug-ins. The .NET reflection API helps run-time loading of plug-in type information. Cheah demonstrates a plug-in and discusses considerations like using attributes and version control.
3. Who Am I? Started programming in 1993. 3 years distinction in eGenting Programming Competition. Specialized in 2D & 3D visualization and computational geometry. Previously co-founder and technical director of a computer game company. Currently developing software for building visualization, documentation, simulation.
4. What is Plug-in? Internet Explorer Add-Ons for third party extensions, search providers, accelerators, etc.
5. What is Plug-in? Microsoft Office Add-Ins provide helpful features and simplify existing Office capabilities.
6. What is Plug-in? Adobe Photoshop filter plug-ins provide extensible image processing capabilities and effects.
7. What is Plug-in? Skype Extras allows you to install additional applications / games that can be used with your Skype contacts list.
8. What is Plug-in? WordPressPlugins are tools to extend its functionality for easy modification, customization, and enhancement to your WordPress blog.
9. What is Plug-in? Comprehensive IP Telephony Services that I developed in 2003. Plug-ins are used to provide a wide range of telephony services like those offered in traditional phone over VoIP network.
10. Why Plug-in? Faster time-to-market for your software. Reduced software size. More extensive and practical software features and capabilities. Less hassle in software upgrade and support. Cheaper and more effective marketing. Greater loyalty from your customers.
11. How to Develop a Plug-in Framework? MainForm IPlugin PluginType1 PluginManager PluginType2 PluginType3
12. What Does PluginManager Do? Loads and initializes plug-ins. Retrieves plug-ins. Executes plug-ins. Disposes and releases all resources of plug-ins.
13. Loading and Initializing Plug-ins Start Initialize plug-in Read all plug-in files Add plug-in to cache Retrieve plug-in in the file Has more plug-in Is valid plug-in? Yes Yes No No Retrieve next plug-in End
14. How Does .NET Reflection Help? .NET Reflection provides run-time loading and inspection of type information.
16. A More Robust Plug-in Framework MainForm PluginApi PluginManager IPlugin
17. Other Design Considerations Using attributes for plug-in metadata. Version control in PluginManager. Different plug-in interfaces for different functional areas. Make PluginApi as an interface that is implemented by MainForm.
Retrieving plug-inmetadata without the need of instantiating the plug-in.Version control to load the latest plug-in when conflict.Make PluginApi as an interface that is implemented by MainForm if most of the application logic and functionalities are located in MainForm.