Difference between framework and library

What you will learn here about Framework vs Library.

  • Difference between Framework and Library

Difference between Framework and Library

1.Framework is collection of libraries. To know more about framework visit the following link.
What is framework
Library is collection of function declaration and defination or collection of classes and interfaces (for Object oriented programming) for particular functionality.
2In case of framework, Framework calls your codeIn case of library, your code calls the library
3User can't modify the framework inbuilt codeUser can modify the code written in library as per requirment if required
4Example: Spring framework, Node js frameworkExample: GSM library, PubSubClient library

The framework will call your code

Let's understand what do you mean by framework will call your code. Consider we have a photo frame, we have to insert the photo into the photo frame. First, we should know the dimensions of the photo frame, By knowing this it is easy to insert the photo into the photo frame. What we are doing here is just inserting the photo which fits into the photo frame. Similarly, any framework environment is almost constant and created by the creators (who created the framework). we have to design our code that suits the framework environment, How we are altering our photo to fit into the photo frame.
  • Photo frame: framework.
  • Photo: code we designed.
  • Photo frame: This has fixed dimensions, height, width, and space provided to insert the photo
Here nothing we can change but we can insert the photo of a size that fits in the space provided to insert the photo.

Your code will call the library:

Let's understand what do you mean by your code will call the library. It is simple and straight forward where ever we include the library in our code, when the control comes to that line where we included the library, the library will be gets attached to our code.

You may also like...