Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between an API, a framework and middleware? [closed]

What's the difference between an API, a framework and middleware? Essentially, all of them provide abstract low level services to apps. In that case, why is dot net called a framework and windows API called, well... an API?

like image 256
Laz Avatar asked Oct 14 '10 15:10

Laz


People also ask

What is the difference between API and middleware?

API refers to callable services, while middleware refers to the product that does the integration work in the integration ecosystem. Middleware is logical Software System that provides capabilities to other software applications, databases etc to be integrated. Middleware is analogous with Integration Software.

What's the difference between an API and a framework?

An API is an interface to a (set of) component(s) encapsulating a functionality. For instance, the GoogleMaps API, the DirectX or OpenGL APIs. A framework is more a set of tools, components aimed at helping the developer to develop his/her project in a given Frame.

Is API part of middleware?

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.

Is API An example of middleware?

Examples of API middleware include API management platforms, API gateways and API developer portals. Object request broker (ORB) middleware acts as broker between a request from one application object or component, and the fulfillment of that request by another object or component on the distributed network.


4 Answers

An API is an Application Programmer Interface. Its just a term that refers to the methods a programmer will use to interface with the software. For example, a DAO might have a save() method. Save is part of the DAO API. At a high level, you might have an Add User to System functionality. Thats part of the system API.

A framework is a tool or set of tools. For example, Spring is a framework that manages your inversion of control, dependency injection, and provides nifty templates to make your life easier. You use Spring via its API.

Middleware is software that allows a bunch of isolated systems or functionalities to interact. So if you have a website, and a payment system, you use middleware to hookem up.

like image 199
hvgotcodes Avatar answered Oct 01 '22 01:10

hvgotcodes


An API is an interface to a programming library (or libraries). It doesn't impose on you a way of doing anything. E.g. OpenGL doesn't restrict what you can do with it.

A framework supplies you with part finished solution to a problem. You fill in the blanks to make what you want. This might accelerate what you are doing, but you are also limited by the limitations of the framework, e.g. design, performance, functionality. -- E.g. MFC provided a way of creating UIs. It supported dialogs well, but not forms, and things like docking were limited and contained bugs. Windows Forms is a much more capable framework (from the architect of Borland Delphi!) which is better in every way: design, flexiblitiy, tools, etc. Frameworks are great until they don't do something you want them to do and then you may lose most of the time you gained trying to work around them.

Middleware is a vertical slice. If you think of software as layered (E.g. OS, hardware abstractions, utility libraries, etc), middleware incorporartes many of these layers vertically. It provides a full, or partial, solution to an area within your application. E.g. a brokered messaging system, or a rendering library/engine. Middleware supplies more than just the basic library, it also supplies associated tools like logging, debugging and performance measurement. One thing you have to be careful about when using middleware is the DRY principle. Because middleware is vertical system, it may compete or duplicate other parts of your application.

like image 29
Nick Avatar answered Oct 01 '22 03:10

Nick


A framework implements an API. The API isolates framework clients from the implementation details of the underlying framework. Thus (broadly speaking) you can use Mono or .Net Framework to run a program based on common source code, because the API to either framework is the same.

Middleware is typically a framework specialized for interprocess communication.

like image 26
Steve Townsend Avatar answered Oct 01 '22 01:10

Steve Townsend


An API is a programatic interface to a system. You use it to interact with a system, but does not force any structure in your program (ideally).

A framework, dictates the way you write certain types of applications in order to reduce the amount of boilerplate needed. It solves some common problems for the applications of it's type.

Middleware is mostly marketing-speak. There are many definitions, but usually involve a big framework with some tooling built around it. Some commercial game engines can be thought of middleware, SOA platforms also are referred as middleware, etc.

like image 43
juancn Avatar answered Oct 01 '22 03:10

juancn