x
Loading
 Loading
Hello, Guest | Login | Register

Living the Dynamic Life of Plg-Ins

Many C and C++ applications use a plug-in or modular architecture to add features dynamically. Unlike monolithic applications, where all features are compiled into a single executable, modular applications typically have a central engine and a set of complementary feature libraries. Each library — usually called a plug-in or a module — implements a unique feature. When that specific feature is needed, the engine simply loads the module on demand, and calls the module to do the work.

Many C and C++ applications use a plug-in or modular architecture to add features dynamically. Unlike monolithic applications, where all features are compiled into a single executable, modular applications typically have a central engine and a set of complementary feature libraries. Each library — usually called a plug-in or a module — implements a unique feature. When that specific feature is needed, the engine simply loads the module on demand, and calls the module to do the work.

In a “pluggable” application, each module typically adheres to a well-defined, prescribed interface, and additional modules can be added at any time, providing ad hoc extensibility.

In Netscape, for example, each plug-in (like the Flash Player or SVG Viewer) is a separate piece of code that adheres to a well-documented interface. When Netscape launches, it loads all of the plug-ins found in its search path, calling the same function (say, initialize()) in each one to discover and register the MIME type that the plug-in handles. In this way, the browser can display an infinite variety of media assets, not just HTML and JPEG, provided that the media type’s corresponding plug-in is available. Other popular modular applications include Adobe Photoshop, the Linux Pluggable Authentication Module (PAM) system, and the GIMP.

Like Netscape or the GIMP, your own applications can use dynamically loaded modules to both simplify the design of your software and provide extensibility.

This month, let’s take a look at how to build a “pluggable” application. The process…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Helpful Tools for Software Developers
  2. The Github Hall of Fame
  3. Book'em, Github.
  4. This Week on Github: Stupid Ruby Tricks
  5. A Veritable Scatter Shot!
Follow Linux Magazine
Rackspace