plug-in architectures
DESCRIPTION
Plug-in Architectures. Presented by Truc Nguyen. What’s a plug-in?. “a type of program that tightly integrates with a larger application to add a special capability to it” - CNET “a set of software components that adds specific abilities to a larger software application” - Wikipedia. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/1.jpg)
Plug-in ArchitecturesPresented by Truc Nguyen
![Page 2: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/2.jpg)
What’s a plug-in?“a type of program that tightly integrates with a larger application to add a special capability to it”
- CNET“a set of software components that adds specific abilities to a larger software application”
- Wikipedia
![Page 3: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/3.jpg)
What’s a plug-in?• Component architectures• Semantics– Plug-ins– Extensions– Add-ons
![Page 4: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/4.jpg)
Plug-ins• Not hard-coded into host app– Unknown at compile time
• Not a standalone application• One step further: compose an entire
application out of plugins
![Page 5: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/5.jpg)
Why do have plug-ins?• Extensible• Modular• Customizable• Keep It Small and Simple!
![Page 6: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/6.jpg)
Traditional vs Pure
![Page 7: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/7.jpg)
Traditional Plug-in• Extend capabilities of base
application• Not compiled into the application
![Page 8: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/8.jpg)
Pure Plug-in• Everything is a plug-in• Plug-ins extend other plug-ins• Where does that leave the base
application?– A run-time engine for plug-ins– Plug-ins become hosts to other plug-ins
by providing extension points• How do plug-ins play nicely with each
other?– Abide by the framework’s or each
other’s rules
![Page 9: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/9.jpg)
Pure Plug-in Engine• Keeping track of where the right
plug-in code is and running it• Maintain a registry of plug-ins and
functions that go with each• Manage extension model and
dependencies between plug-ins
![Page 10: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/10.jpg)
Plug-in Design Patterns• Best practice solutions to solve a
design problem• How to support dynamic loading of
modules unknown during compilation
![Page 11: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/11.jpg)
Plug-in Pattern
![Page 12: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/12.jpg)
Eclipse• Well known as a Java IDE• Pure plug-in architecture– Runtime engine itself is a bunch of core
plug-ins except for tiny bootstrap code• Universal plug-in architecture for
creating “anything, but nothing in particular”
• Each plug-in has a manifest
![Page 13: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/13.jpg)
Eclipse
![Page 14: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/14.jpg)
Gecko (NPAPI)• Netscape Plugin Application
Programming Interface• Plug-in is completely controlled by
web page that calls it• On start, Gecko looks for plug-in
modules in a specified locations on the system
• On a page with certain embedded media, checks for plug-in with matching MIME type creates new instance and runs it
![Page 15: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/15.jpg)
Photoshop• Central Plug-in loader– Scans PiPL (Plug-in Property List)
• Fixed types– filter, import, export, file format,
automation– selection and parser (not implemented
by 3rd party)• Non-Photoshop applications can
support Photoshop plug-ins
![Page 16: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/16.jpg)
Chrome• Scripting API vs Browser API• Extensions can modify the DOM• Can have access to the history,
current tabs, bookmarks, etc• Composed of files, can be packaged
as .crx–manifest.json– HTML files– JavaScript– Other resources (e.g CSS, images)
![Page 17: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/17.jpg)
Chrome• Background pages– Persistent or event
• Content scripts are JS that executes in the context of the page just loaded– Can change the DOM on the current
page– Can’t change the DOM on the
background page of parent extension• Callbacks execute on a user action
![Page 18: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/18.jpg)
Challenges• Installing and updating– Configuration plugin
• Security• Concurrent plug-in version– Eclipse convention: Only plug-ins that
contribute code libraries can coexist• Scalability
![Page 19: Plug-in Architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070423/568166cb550346895ddad7a7/html5/thumbnails/19.jpg)
Questions?