interface ISyntaxHighlighter { ... } class PerlSyntaxHighlighter implements ISyntaxHighlighter { ... } How does the application know when to use a new plug-in class? How can the application instantiate a new plug-in class? At installation time the plugin must register with the application. class SyntaxHighlighterRegistry { ... void RegisterSyntaxHighlighter(String name, String className, String[] fileExtensions) { ... } ISyntaxHighlighter CreateSyntaxHighlighter(String fileExtension) { // use reflection API to instantiate the appropriate plug-in class ... } void UnregisterSyntaxHighlighter(String name) { ... } void Load(File file) { // load configuration from XML file ... } void Save(File file) { // save configuration to XML file ... } }