Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

API vs Toolkit vs Framework vs Library

My question is very simple, and I want a clear answer with a simple example.

What's the main difference between API, Toolkit, Framework, and Library?

like image 356
Azzurrio Avatar asked Mar 27 '11 22:03

Azzurrio


2 Answers

I prefer following:

  1. An API is an abstract description of how to use an application. For example, an API may describe the function syntax (declaration) of a chat server. i.e. login, publish_message, subscribe_messages. And, it describes any protocols to use the application. i.e. must login before sending or recieving messages, or clients are dropped after 2 minutes if not sending or receiving messages.
  2. A library is an implementation of an API, it containes the compiled code that implements the functions and protocols (maintains usage state).
  3. A toolkit is a set of libraries (API) and services grouped together to provide the developer with a wider range of possible solutions. For example, the Globus Toolkit provides services (such as File transfering, Job Subission and Scheduling) that a devleoper can install and start on their servers. They also provide API's to build applications that may use the services deployed in an integrated fashion. For example, the developer may build a program that uses the Job Submission API to communicate with the Job Submission Service.
  4. A Framework is a set of guidelines that prevents inappropriate use or developement. The developer must contruct their applications within the rules and boundaries of the framework. This is done by forcing the developer to extend the current framework to develope new software. by extending the framework, you force adhearence to the framework.

I'm not saying these are completely correct, but its worked ok for me so far!

like image 89
Ron Avatar answered Nov 20 '22 20:11

Ron


This has always been my understanding, you will no doubt see differing opinions on the subject:

API (Application Programming Interface) - Allows you to use code in an already functional application in a stand-alone fasion.

Framework - Code that gives you base classes and interfaces for a certain task/application type, usually in the form of a design pattern. (Though not always)

Library - Related code that can be swapped in and out at will to accomplish tasks at a class level

Toolkit - Related code that can be used to accomplish tasks at a component level.

like image 39
Ryan Bennett Avatar answered Nov 20 '22 20:11

Ryan Bennett