Software vs Middleware: Explained with Examples.

In this article, let us learn what the term “Middleware” means and see how that differs from the terms “Software”. Let us also see how these 2 types of code fits in the spectrum of “Computing” with the help of a few examples!

I have written this article keeping beginners in mind, hence I have tried not to use too much “Technical Jargon” in this article. So, let us begin!

For those of you in a hurry, here is the short version of the answer!

The Short Version of the Answer

Middleware technically is a sub-class of software. Other than the fact that middleware is a computer program, middleware has major differences from his other software brothers. The table below shows the main differences between middleware and other types of Software

MiddlewareSoftware
Middleware is a type of software that connects 2 software together and enable them to exchange informationSoftware is any computer program, which can be classified based on how far the code lives from the hardware into
* applications,
* middleware,
* operating systems,
* device drivers, and
* firmware
Examples of middleware includes APIs like REST APIs, tools like Cygwin and MinGW to run UNIX software on Windows, etc.Examples of software (other than middleware) include operating systems like Windows, Linux, and android, applications that run on top of these operating systems like MS Office, Browsers, Games, and apps that we download from App stores, etc.

If you did not completely understand the above table, don’t worry as that is just the short version of the answer. Read on for the longer version of the answer below where I try to answer the following questions

  • What is middleware?
  • What are some examples of middleware?
  • What are some types of middleware?
  • What is software?
  • What are some different sub-classes of software?
  • How middleware differs from other types of software?

So let’s continue with more informative version of the answer!

Middleware vs Software

Middleware

What is Middleware? Middleware is a computer program that connects 2 software together. The 2 software that needs to connect can be in the same machine or in 2 machines in the same room or it can be in 2 corners of the world.

According to RedHat

Middleware is software that provides common services and capabilities to applications outside of what’s offered by the operating system. Data management, application services, messaging, authentication, and API management are all commonly handled by middleware.

redhat.com

The job of middleware is to combine the 2 programs and make a bigger one. This one is a bit tricky as the 2 “wares” that the middleware connects can be anything as mentioned in the above paragraph.

According to Microsoft middleware acts as plumbing between software to make them interchange data.

Middleware are everywhere, they are a very broad class of software, let us have a look at some examples of how middleware is employed in the world of software.

Examples of Middleware

Example#1: Web Services Middleware

Most common example of a middleware that you might have already seen while browsing around in the internet are REST APIs. If you see a website that shows their store location using a small windows with google maps inside, they are using the REST API from Google.

REST stands for REpresentational State Transfer, while the name might sound overly complicated and too technical, the duty of REST is fairly simple. REST acts as a middleware between a server and a web application. In simpler words the Google REST API acts as a middleman between a given website and the Google server and helps them communicate with each other. Other famous implementations of REST APIs include Facebook, Instagram, Twitter etc.

Example#2: Distributed System Middleware

Let us see another example of Middleware, this time in the area of “Distributed systems“. Consider the hundreds of individual weather stations located all over the world. These sensors might be from different manufacturers giving output in different formats like Celcius, Fahrenheit, etc. The program get the data from all these different sensors and and gives this combined data to the software that gives out the weather predictions is an example of middleware!

Example#3: Cross Platform Support Middleware

As you might know, an application written for one operating system will not not on another. For example an exe file made for Windows will not just run on another operating system like Mac OSX or Linux.

This is because, the applications usually involves system calls which are specific to a given operating system. But using a middleware you can translate the system calls and make a given application run on several operating systems. For Example, Cygwin and MinGW are 2 middleware which simulate a UNIX like environment inside Windows and helps us port UNIX software to Windows. You can read more about them here

The reason behind the name “Middleware”

This is simply the fact that “middleware” sits between 2 other “wares” as we saw in the 2 examples above.

The Other Types of software

Operating System

Let’s start with the software that you are all familiar with i.e Operating Systems.

What is an operating system? An operating system is a program that abstracts the underlying software with the aim of improving the efficiency and ease of use both for the end-users and application programmers.

An OS does its job by abstracting the memory, processing power and I/O such that multiple processes can run simultaneously by sharing the available hardware resources without the knowledge of each others’ existence.

Mainstream examples include Windows, Mac OS, and Linux’s various distros for computers and Android and iOS for smartphones. For embedded devices, examples include FreeRTOS, Contiki and embedded Linux.

Device Drivers

What are device drivers? Device drivers are programs that can control a given hardware and provide a software interface to it. Other programs like Operating Systems can interact with the hardware through this software interface without needing to know the actual underlying implementation of the software interface.

An interface is nothing but a group of functions. All operating systems talk to hardware via some predefined software interfaces.

For example, I could design an operating system that hands Wireless cards with 4 predefined functions/interface as below

turn_wifi_on()

turn_wifi_off()

connect(string AP_name, string password)

disconnect()

Every Wireless card manufacturer who wants to make his device work on my operating system must provide a driver software which has these 4 functions. My operating system can then happily call these functions whenever the end-user needs something to be done. This is just a simple example of how drivers are implemented. I hope you got the point.

Applications

Applications run on top of device drivers and operating systems. Example of applications include Browsers, Word processors, Multimedia players, etc.

These applications cannot talk to the hardware directly. Instead, it does it through the operating system and its system calls.

How Software Differ from Middleware

Now that we have seen what both the terms “Software” and “Middleware” mean, let us see have a look at the table from the beginning of the article again!

MiddlewareSoftware
Middleware is a type of software that connects 2 software together and enable them to exchange informationSoftware is any computer program, which can be classified based on how far the code lives from the hardware into
* applications,
* middleware,
* operating systems,
* device drivers, and
* firmware
Examples of middleware includes APIs like REST APIs, tools like Cygwin and MinGW to run UNIX software on Windows, etc.Examples of software (other than middleware) include operating systems like Windows, Linux, and android, applications that run on top of these operating systems like MS Office, Browsers, Games, and apps that we download from App stores, etc.

Hence to make it really short Middleware is a class of software, which acts as a translator between 2 software to help them communicate with each other.

I hope by now, you are clear with what these terms mean, how middleware differs from other types of software where each of these software-types is employed in the world of computing!

And with that I will stop this article!

Hope you enjoyed reading this article and learned something useful!

Feel free to share this article with your friends and colleagues!

Here are some of my other articles that might interest you!

Related Articles

Firmware vs Software: Explained with Examples!

Firmware vs Embedded Software: Explained with Examples!

Photo of author
Editor
Balaji Gunasekaran
Balaji Gunasekaran is a Senior Software Engineer with a Master of Science degree in Mechatronics and a bachelor’s degree in Electrical and Electronics Engineering. He loves to write about tech and has written more than 300 articles. He has also published the book “Cracking the Embedded Software Engineering Interview”. You can follow him on LinkedIn