MicroKernel Architecture Pattern

The concept of Microkernel as Software Architecture Pattern has emerged from the principle of design of Operating System where the system is modularized basically in two parts - Kernel and the System Software.

The kernel is the heart of the operating system, whereas System Software is the other part of the body. The kernel is responsible for memory management, process Management, Inter-process communication, etc. Others like compiler, linker, and device driver are System Software, plugged into the operating system which, ultimately calls to the kernel to get their work done. The kernel is the basis that defines what we can achieve with the System.

The same design principle can also be applied to another kind of software that is evolutionary in nature in such a way that its entire foreseeable enhancement could be accomplished just by using the basic functionalities offered by the Kernel.

One such application I am going to describe here is ReportGen. ReportGen is responsible for generating the reports. Let’s first see its architecture.

MicroKernel Architecture Pattern

About Application ReportGen

ReportGen is the application that facilities generating a report in configurable format (pdf, excel, CSV, etc) and sends the report to a configurable destination (Email, Ftp Server, Printer) and others.

How does it work?

The developer of the Report creates Plugin. Consider Plugin as jar file or dll. Every Plugin implements an Interface that has the method PrepareReportData(). This method is responsible for fetching and preparing the data as it has all the queries/stored procedure/Business logic to fetch and construct the data which the report will consist of. The kernel has an exposed interface to Add Plugin (Register plugin). Before running the report developer registers this Plugin with the kernel. Once the plugin is registered, the developer through her/his client application sends a request to Kernel to execute the report. The kernel then follows below-defined steps:

  1. Based on the request parameter, locate the assembly (Plugin) and load it in the separate application domain.
  2. Execute its Method PrepareReportData() (use .Net Reflection) to fetch the data from DataLink Server(internal Server of the Kernel).
  3. Send the data to another RepGen internal Server to prepare the report in the specified format.
  4. Once the Report is prepared, send the Report to a specified destination through Report Distribution Server.

Let’s talk about each component of the diagram given above to see how they fit together in action.

RepGen Kernel

The kernel is the nucleus of application. It has primitive functionalities which the registered plugins use to get their task done.

Here you can see Kernel is not concerned what the implementation of Plugins –what business logic it executes. It simply executes them using reflection.

DataLink Server

Report Distribution Server

This is all about a brief description of the Microkernel Architectural pattern. Finally, let’s discuss few considerations.

References

  1. Pattern-Oriented Software Architecture by Frank Buscmann, Regine Meunier, Hans Rohnert,Peter Sommerlad, Michael Stal.
  2. https://homes.cs.washington.edu/~bershad/590s/papers/towards-ukernels.pdf