UPI Study › Courses › Software Engineering › Free lessons › Lesson 15.1 Free with a free account
Middleware: The Glue Between Software Layers
Software Engineering · Chapter 15: Distributed Systems, Services, and Sociotechnical TopicsSection 15.1 · lesson 95 of 1035 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Software Engineering.
Lesson complete
Earn the 3 college credits for Software Engineering
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Client-Server Networks: How They Work and When to Use Them →← How Distributed Computing Works: Principles and EnvironmentsNext lesson: Client-Server Networks: How They Work and When to Use Them →
In this lesson
Handling the mechanics of getting separate pieces to talk.
- Explain what middleware does, and where it sits
- Explain the complexity problem it solves as components multiply
- Describe 3 common types of middleware
- Choose between asynchronous and synchronous communication
Transcript
Everything said in the video, section by section (708 words). Read along, or search it.
Distributed Systems, Services, and Sociotechnical Topics
Middleware: The Glue Between Software Layers
A distributed system is made of separate pieces, running on separate machines. Something still has to handle the actual mechanics of getting them to talk to each other. That something is middleware.
What Middleware Does
Between the Components
In a distributed system, separate components run as separate programs, often on separate machines entirely. They share no memory, and they may even be written in different languages. For them to work together, something has to carry a message, a request, or a piece of data from one to another, across a network. Middleware is the software layer that does exactly that. It sits between the components, and takes care of the mechanics of communication. So each component's own code can focus on what it is actually meant to do, rather than reimplementing networking and data translation.
The Problem It Solves
Connections Multiply
Without a shared layer, every component that needs to talk to another needs its own custom connection to it. And as the number of components grows, the number of direct connections grows much faster. Five components, wired directly to each other, already need ten separate connections, each with its own quirks to maintain. Adding a sixth component would mean five new direct connections. Through middleware, adding that sixth component means exactly one.
Figure 1
From a Tangle to a Hub
Here is the difference. On the left, five components are wired directly to each other. That is ten connections, and the tangle grows with every new component. On the right, the same five components each connect only to the middleware. Each one has just one connection to maintain, and the middleware gets each message to wherever it needs to go.
Think About It
Is There Less Communication?
Think about this. In the middleware picture, every component is still, ultimately, communicating with every other one. So has the amount of communication actually gotten any smaller? No. The total communication is the same. What has gotten smaller is the number of connections each component has to know how to maintain. The complexity of managing it has shrunk.
Table 1
3 Common Types of Middleware
Middleware is not one single technique. Several approaches solve the same problem in different ways. With message-oriented middleware, components exchange messages through a shared queue. The sender does not wait for the receiver to be ready. With a remote procedure call, a component calls a function on a remote component much like calling a local one, and waits for the result. And with an object broker, a broker locates the right remote object, and routes the call to it on the caller's behalf.
What Matters in Practice
Timing - and Location
The difference that matters most in practice is timing. Message-oriented middleware is asynchronous. Component A sends its message and moves on, without needing B to be running or ready at that moment. A remote procedure call is synchronous. A calls, and then waits, just as it would for a local function. That is simple to reason about, but it means A is stuck until B responds. An object broker adds one more job. It figures out where the right remote object actually is, so the caller never has to track that location.
Apply It
B Might Be Offline
Let's apply that. Component A needs to notify component B of an event. But B might be temporarily offline when the event happens, and A should not have to wait for it. Which middleware fits? Message-oriented middleware. It is asynchronous, so A can put its message in the queue and continue. And B can retrieve the message once it comes back online.
Key Terms
The Vocabulary of This Section
Let's lock in the key terms. Middleware is the software layer between distributed components that handles the mechanics of communication between them. Message-oriented middleware passes messages through a shared queue, without the sender waiting for the receiver to be ready. A remote procedure call lets a component call a function on a remote component like a local one, waiting for the result. And an object broker locates the correct remote object, and routes a call to it on the caller's behalf.
Key Takeaways
What to Carry Forward
To pull this together. Middleware handles the mechanics of communication between distributed components, so their own code does not have to. Without it, direct connections grow much faster than the number of components. Middleware collapses that tangle, by giving each component one connection to maintain. Message-oriented middleware is asynchronous, and remote procedure calls are synchronous. And an object broker also locates the right remote object, before routing a call to it.
About Software Engineering at UPI Study
Software Engineering (Computer Science 301) is a self-paced online course of 103 video lessons in 15 chapters, from process models and agile to requirements, design, user interfaces, reliability, security and project management. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Why take it here
Why students take Software Engineering with UPI Study
Where the credit goes
Universities that work with NCCRS
Software Engineering carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Middleware: The Glue Between Software Layers
What is middleware in a distributed system?
Why does middleware reduce complexity as a system grows?
What is the difference between message-oriented middleware and remote procedure calls?
What does an object broker do in middleware?
About the Software Engineering course
How many college credits is Software Engineering?
How much does Software Engineering cost and what is included?
Which universities accept UPI Study credits?
How long does Software Engineering take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Software Engineering.
103 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
3 credits · NCCRSEnroll →