What Is The Difference Between A Framework And A Library In Any Programming Language Like Javascript?
Solution 1:
A library is essentially a set of functions that you can call, these days usually organized into classes. Each call does some work and returns control to the client. Eg. jQuery.
A framework embodies some abstract design, with more behavior built in. In order to use it you need to insert your behavior into various places in the framework either by subclassing or by plugging in your own classes. The framework's code then calls your code at these points. Eg. Angular JS
KeyDifference: The key difference between a library and a framework is “Inversion of Control”. When you call a method from a library, you are in control. But with a framework, the control is inverted: the framework calls you.
Relation: Both of them defined API, which is used for programmers to use. To put those together, we can think of a library as a certain function of an application, a framework as the skeleton of the application, and an API is connector to put those together. A typical development process normally starts with a framework, and fill out functions defined in libraries through API.
Solution 2:
In very simple words -
Framework provides the complete skeleton of your app. E.g. Express.js
Library is a set of functions, what you can use as utilities in your app. E.g. JQuery
Post a Comment for "What Is The Difference Between A Framework And A Library In Any Programming Language Like Javascript?"