What is the difference between an API , framework and middleware?

后端 未结 5 839
暖寄归人
暖寄归人 2021-01-30 09:10

Just Randomly got this question in my head! Whats the difference between API , Framework and middleware? Essentially all of them provide abstract low level services to apps. In

相关标签:
5条回答
  • 2021-01-30 09:45

    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.

    0 讨论(0)
  • 2021-01-30 09:49

    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.

    0 讨论(0)
  • 2021-01-30 09:50

    The main difference is the purpose of functionality.

    An API is designed to solve some specific problem in a particular domain.it contains necessary data structure, classes,methods,interface etc. Such as ADO.net API provides the functionality to connecting Microsoft SQL Server.

    A framework designed to help developer to reusable,scalable software application.a frameworks has no specific functionality like API but its various functionality exposed by API . Such as , ADO.net is an API of .net framework for accessing data service. A framework has compiler, programs,class libraries,run-time.it can add plug-in.

    0 讨论(0)
  • 2021-01-30 09:52

    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.

    0 讨论(0)
  • 2021-01-30 10:07

    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.

    0 讨论(0)
提交回复
热议问题