The focus of this episode on software architecture patterns is the microkernel pattern.  It is a common way to build on core technology without the need for future design.  Once the plugin interface is defined, the sky is the limit for enhancements and upgrades.  You do all of this without impacting that core.

The Microkernel Pattern Defined

This approach starts with a core piece of functionality.  Next, other components are added to it.  We see this pattern utilized in many cloud products and commercial software.  The core can be protected, and then plugins farmed out.  Also, customers can purchase the core and then plugins a la carte.  In a technical sense, the core provides shared functionality across the system.  The plugins allow us to upgrade or enhance the core in a focused way. 

The core is not touched with this pattern and can provide a stable foundation.  The enhancements are plugged in and thus not likely to impact the overall system negatively.  We define the interface that allows for the plugin, and then it is up to future developers to expand on the solution.  The plugin interface is often thin and straightforward, leaving the plugins nearly stand-alone modules.  Likewise, we can split a more extensive solution into smaller pieces that are easier to manage.

Applying The Pattern

The opportunities are endless for this pattern.  We can solve small problems with hooks included for plugins.  Likewise, we can build enterprise systems that allow for future expansion.  Of course, there is an overhead cost of a plugin interface.  However, that can often be kept to a minimum when limited data needs to be shared.  Finally, there are many examples of this pattern out in the wild, and a search can find excellent reference projects.

Challenges

The best use of this pattern is when you have a well-defined core and multiple implementations of some features.  Note that the plugins can be numerous and different in the service they provide.
For example, the various ports on the back of a desktop computer provide different plugin options.  We can leave some of our implementation details for the future and focus on what we have in front of us today.  The microkernel architecture allows for “plug-and-play” options and testing partial solutions.  That adds up to excellent benefits.

Rob Broadhead

Rob is a founder of, and frequent contributor to, Develpreneur. This includes the Building Better Developers podcast. He is also a lifetime learner as a developer, designer, and manager of software solutions. Rob is the founder of RB Consulting and has managed to author a book about his family experiences and a few about becoming a better developer. In his free time, he stays busy raising five children (although they have grown into adults). When he has a chance to breathe, he is on the ice playing hockey to relax or working on his ballroom dance skills.

Leave a Reply