Middleware has two separate but related meanings. One is software that enables two separate programs to interact with each other. Another is a software layer inside a single application that allows different aspects of the program to work together.
The most common type of middleware is software that enables two separate programs to communicate and share data. An example is software on a Web server that enables the HTTP server to interact with scripting engines like PHP or ASP when processing webpage data. Middleware also enables the Web server to access data from a database when loading content for a webpage. In each of these instances, the middleware runs quietly in the background, but serves as an important "glue" between the server applications.
Middleware also helps different applications communicate over a computer network. It enables different protocols to work together by translating the information that is passed from one system to another. This type of middleware may be installed as a "Services-Oriented Architecture" (SOA) component on each system on the network. When data is sent between these systems, it is first processed by the middleware component, then output in a standard format that each system can understand.
Middleware can also exist within a single application. For example, many 3D games use a "3D engine" that processes the polygons, textures, lighting, shading, and special effects in the game. 3D engines are considered middleware, since they bring different aspects of the game together. For example, the game's artificial intelligence works in conjunction with the 3D engine to create the gameplay.
Game engine middleware includes a custom API, which provides developers with standard functions and commands used for controlling objects within the game. This simplifies game development by allowing programmers to use a library of prewritten functions rather than creating their own from scratch. It also means 3D engines can be used in more than one game.