Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.

Slides:



Advertisements
Similar presentations
Connecting to Databases. connecting to DB DB server typically a standalone application Server runs on localhost for smaller sites –i.e. Same machine as.
Advertisements

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Visual Designer for JasperReports
Goals Give you a feeling of what Eclipse is.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Distributed Application Development B. Ramamurthy.
1 Introducing Collaboration to Single User Applications A Survey and Analysis of Recent Work by Brian Cornell For Collaborative Systems Fall 2006.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
1 Plug-in Development Environment (PDE) Guide. 2 Introduction to PDE l What is PDE: »a tool designed to help you develop platform plug-ins while working.
Tahir Nawaz Visual Programming C# Week 2. What is C#? C# (pronounced "C sharp") is an object- oriented language that is used to build applications for.
ODBC and JDBC What are they – libraries of function calls that support SQL statements Why do we need them –Provide a way for an application to communicate.
6/1/2001 Supplementing Aleph Reports Using The Crystal Reports Web Component Server Presented by Bob Gerrity Head.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Software Engineering Muhammad Fahad Khan
From BlueJ to NetBeans SWC 2.semester.

Helena Pomezná, ciz034 St. skupina: L392 FEI, VŠB-TUO Ak. rok. 2002/2003 Download:
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Developing Web Services with the Eclipse Web Tools Platform Boris Minkin.
Stimulsoft Reports.Net 20 Problems which Stimulsoft Reports.Net solves
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
October 30, 2007S. Weigert / Y. HAN1 Working with Eclipse-Ingres RUBIS Autumn 2007.
Arc: AddIns Dr Andy Evans. Java Direct access to ArcObjects Framework inside and outside Arc. Ability to add components to the GUI. Ability to communicate.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
MySQL, Java, and JDBC CSE 3330 Southern Methodist University.
Designing and Developing WS B. Ramamurthy. Plans We will examine the resources available for development of JAX-WS based web services. We need an IDE,
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
POS 406 Java Technology And Beginning Java Code
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
Installation and Development Tools National Center for Supercomputing Applications University of Illinois at Urbana-Champaign The SEASR project and its.
Hands-On Microsoft Windows Server Implementing Microsoft Internet Information Services Microsoft Internet Information Services (IIS) –Software included.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
Frameworks CompSci 230 S Software Construction.
6/1/2001 Supplementing Aleph Reports Using The Crystal Reports Web Component Server Presented by Bob Gerrity Head.
© 2006 Intland Software1 Aron Gombas Architect, Intland Software Extending & customizing CodeBeamer.
12/6/2015B.Ramamurthy1 Java Database Connectivity B.Ramamurthy.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Wizards for the OMNeT++ IDE András Varga OMNeT++ Workshop March 19, 2010 Malaga, Spain.
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
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.
CSI 3125, Preliminaries, page 1 JDBC. CSI 3125, Preliminaries, page 2 JDBC JDBC stands for Java Database Connectivity, which is a standard Java API (application.
Unit 1 – Web Concepts Instructor: Brent Presley.
Secure Search Engine Ivan Zhou Xinyi Dong. Project Overview  The Secure Search Engine project is a search engine that utilizes special modules to test.
Visual Basic Integrated Development Environment (IDE) 56:150 Information System Design.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS Jan Control System Studio Training - Extension Points:
Test Automation Using Selenium Presented by: Shambo Ghosh Ankit Sachan Samapti Sinhamahapatra Akshay Kotawala.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Java Server Pages. 2 Servlets The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
The Holmes Platform and Applications
Introducing the Microsoft® .NET Framework
Topic 2: Hardware and Software
ODBC, OCCI and JDBC overview
Goals Give you a feeling of what Eclipse is.
Writing simple Java Web Services using Eclipse
The Improvement of PaaS Platform ZENG Shu-Qing, Xu Jie-Bin 2010 First International Conference on Networking and Distributed Computing SQUARE.
PHP / MySQL Introduction
Getting Started ARCS Lab..
Java Database Connectivity
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
COMPONENTS – WHY? Object-oriented source-level re-use of code requires same source code language. Object-oriented source-level re-use may require understanding.
Java Remote Method Invocation
Web Application Development Using PHP
Plug-In Architecture Pattern
Presentation transcript:

Plug-In Architecture Pattern

Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment extensions is large Specific details on future extensions are not available, but their general nature is predictable It should be possible to extend the system without access to the system's source code, by people who were not the system's original developers It should be easy to add and remove extensions in whatever combination is desired by the customer

Example : Syntax Highlighting You are writing a text editor intended for use by software developers You want to support syntax highlighting, but the set of possible programming languages is unbounded Even if you could list all of the possible languages, you don't have enough resources to implement syntax highlighting for them all Third-party developers and end-users will need the ability to add syntax highlighting for their favorite languages without your help

Solution Define an abstract interface that captures the general nature of the necessary extensions –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 –ExampleExample

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

Solution

Dynamic Behavior : Plug-in Registration

Dynamic Behavior : Plug-in Selection and Execution

Dynamic Behavior : Plug-in Un-registration

Implementation Plug-ins are frequently implemented as dynamically-linked libraries The host application loads the plug-in DLLs that have been registered Registration techniques –Just copy the plug-in DLL into a special directory. The host application loads all DLLs in the plug-in directory, and queries each DLL for information about its plug-in –Installer puts an entry in a configuration file that indicates where the plug-in DLL is located

Implementation In Java a plug-in could be a.class file containing the plug-in class Registration could be as simple as putting the name of the plug-in class in a configuration file The host application uses reflection to instantiate plug-in classes by name, which causes the classes to be loaded into the VM

Known Uses Web browser plug-ins for different file formats –PDF, PowerPoint, Word, etc. Web servers –Apache Modules SSL, user authentication, caching, logging, etc. –IIS ISAPI Extensions MS-Windows compound documents –"Insert Object" menu in many Windows applications

Known Uses Syntax Highlighting Eclipse –Framework for building integrated development environments (IDEs) –Provides basic shell for IDE UI –All actual work is done by plug-ins for specific development tasks Editors, compilers, debuggers, wizards Database drivers –Generic database APIs: ODBC, JDBC –Plug-in drivers for specific DBs: SqlServer, MySQL, Postgres, etc.

Consequences Results in a system that can be extended: –After it's shipped –By people other than the original developers –Without recompiling the system Users are free to choose which plug-ins they want to install Commercial opportunities for third-party plug-in developers Buggy plug-ins can destabilize the system since they're usually loaded directly into the host application process (crashes, memory leaks, etc.)

Plugin Example package plugin; public interface QPlugin { public void sayHi(); } This interface needs to be in two places: The JAR with the plugin The application that is using the plugin

Plugin Example package plugin; public class MyQPlugin implements QPlugin { public void sayHi() { System.out.println("Hi There World!!"); } This is the implementation of the plugin This needs to be in the plugin JAR

import java.net.URL; import java.net.URLClassLoader; import plugin.*; public class PluginExample { /** args */ public static void main(String[] args) { printClasspath(); Class c = null; try { c = Class.forName("plugin.MyQPlugin"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } QPlugin q = null; try { q = (QPlugin)c.newInstance(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } q.sayHi(); }

public static void printClasspath() { //Get the System Classloader ClassLoader sysClassLoader = ClassLoader.getSystemClassLoader(); //Get the URLs URL[] urls = ((URLClassLoader)sysClassLoader).getURLs(); for(int i=0; i< urls.length; i++) { System.err.println(urls[i].getFile()); } }