Interface isyntaxhighlighter extensions are

This preview shows page 4 - 8 out of 14 pages.

interface ISyntaxHighlighter { … } Extensions are components that implement the abstract interface class PerlSyntaxHighlighter implements ISyntaxHighlighter { … } How does the application know when to use our plug-in class? How can the application instantiate our plug-in class? It doesn’t know the class name to call “new” on ( PerlSyntaxHighlighter ) At installation time, a new plug-in has to “register” with the application Example
Image of page 4

Subscribe to view the full document.

Solution Extensions are called "plug-ins" because they can be "plugged in" to the system without recompilation The system instantiates plug-in components indirectly through a registry The system invokes plug-in functionality through an abstract interface
Image of page 5
Solution +Op1() +Op2() +Op3() «interface» Plugin ConcretePluginB ConcretePluginA +RegisterPlugin(in descriptor : PluginDescriptor) +GetAvailablePlugins () : PluginDescriptorIterator +CreatePlugin(in descriptor : PluginDescriptor) : Plugin +UnregisterPlugin(in descriptor : PluginDescriptor) +LoadConfig() +SaveConfig() PluginRegistry HostApplication «interface» PluginDescriptorIterator -name -className -description PluginDescriptor 1 * 1 1
Image of page 6

Subscribe to view the full document.

Dynamic Behavior : Plug-in Registration Plugin Installer PluginRegistry RegisterPlugin(descriptor) PluginDescriptor New populate
Image of page 7
Image of page 8
You've reached the end of this preview.
  • Fall '08
  • Woodfield,S
  • Web browser, File format, Syntax highlighting

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern