• Increase font size
  • Default font size
  • Decrease font size

Building a Better Plugin Architecture

by martin on September 8th, 2010

This article by Markus Ewald guides you through the design of a simple C++ plugin architecture based upon Factory classes. He also includes a fully working example implementation of his plugin system for you to download.

Markus presents a number of benefits of using plugins:

  1. Increased clarity and uniformity of code
  2. Improved modularization of code
  3. Shorter compile times
  4. Replacing/adding components

He also lists a further benefit of being able to use GPL code in a closed source project, although I do not believe that the GPL license allows this. The GPL FAQ states:

“If the program uses fork and exec to invoke plug-ins, then the plug-ins are separate programs, so the license for the main program makes no requirements for them. So you can use the GPL for a plug-in, and there are no special requirements. If the program dynamically links plug-ins, and they make function calls to each other and share data structures, we believe they form a single program, which must be treated as an extension of both the main program and the plug-ins. This means that combination of the GPL-covered plug-in with the non-free main program would violate the GPL.”

From → Extending

Comments are closed.

ABOUT THIS SITE

An Application Programming Interface (API) provides a logical interface to a piece of software and hides its internal details. This website is dedicated to a book on designing APIs for C++ and includes articles and links on API development.
 

SOURCE CODE

The book is accompanied by a source code package that contains many of the examples in the text. Download it for free.
 

OTHER BOOKS

Dr. Reddy has also published a computer graphics book called Level of Detail for 3D Graphics. Check it out too!.
 
Copyright (c) 2019 Martin Reddy. All rights reserved. Login