Difference between framework and library

muskan sawa
2 min readJan 20, 2021

I am not ashamed to admit that for a long time I did not really understand that why some prewritten code for the other developers to use in their code were called libraries and some were called framework. Both of them had the same job of saving the developers time from coding mundane things and to really focus on their product. then why use different terminology for each.

To sum it up in short , libraries are when you have the control and use bits of already written code pieces into your code, contrary frameworks are mostly rigid and their is an inversion in control . you can only add a little bit of your own touch according to your requirements.

libraries are more like tools you can use here and there as you wish , framework are more like fill in the blanks and you will get you work done .

for example there is collections framework in java , consisting of interfaces and classes that perform similar tasks such creating a group of object . n that they provide different type of collection like vector Arraylist which are data structure that are defined in a certain way that cant be changed and is mostly rigid.

on the contrary the libraries in java like java.lang , java.io and java.util are there to deliver you what you need but not tell you what to do. example java.math , you can call Math.sqrt() to take out root of either sum of two numbers or difference of two numbers its really upto you depends on your application really.

In the end both have their own application and significance and should be used wisely to save both developing and processing time.

--

--

muskan sawa
0 Followers

Adventurer in the mind jungle. All about magical stuff in binaries.