after reading this article you won’t be searching for this topic any more further.
now let me tell you what the issue is many times people try to just say understand what the is a library and then try to understand what is a framework.
first of all you have to know Angular Js is a framework and React Js is a library.
and you’ll get bored the answers there but it is not perfectly a correct thing you need to understand both of the side of the thing by side now if you look out into any definitions or Wikipedia or something like that.
you will find a quite a common definition which is a collection of library is a framework which can be true or cannot be always true so you need to understand both sides by side.
let’s move on to the first example,
so library and framework both of them are dependent on rule one is your home and another one is just like your school or your university.
so I’m making an analogy here that your school is your framework and your home is just like your library ok so here is my point
when you have fewer rules it is more likely that it is going to be possibly a library and when there are more rules than it there are high chances that it’s going to be a framework for example in your home. you can just throw off your t-shirts wherever you like and you can just place your bag wherever you like.
but when you go to school or university there are fixed places where you put your bag there are fixed places.
most of the time that where you are going to be sitting up your marker for your teacher has a fixed place that it’s going to be there are some options that you can change them like here or there a little bit but it’s always gonna be closer to the teacher.
so that’s more like you are bounded by more rules while on the other hand at home there is less number of rules yes you may like to follow some rules but most of them are built by you.
so the library is moreover like your home it’s like whatever I want to do I’m gonna be doing it and similarly on the framework is more bounded by the rules that you are only allowed to do certain kind of things.
yes you can go ahead and change all of them but it takes time and Polly such thing
now let’s move on to the second example
This second example is moreover code-oriented and the people who are associated with a little bit kind of the code even like simple JavaScript or jQuery will be able to understand it
much better now in a simple library is simply a collection of codes obviously.
so some functions or some like document object model or all these such things are being packed together and is being used over and over that’s basically your library is now trying to understand in this manner.
now whenever you are making a call to any library that is most likely to be a library so whenever you have the power to call the code whenever you like.
that is simply a library on the other hand in the framework actually your framework calls your code and further your code can call to a library.
maybe but notice the difference here in the library you are making a call to the library but in the framework is actually calling to your code so just understand in this manner.
let’s take in another very beautiful example
which is a difference between jQuery and simply Django less or there are many other frameworks.
as well so in both of these things whenever you want to make a call to a jQuery library you can make it on the other hand in the Django there are more restrictive environments.
for example, your templates folder should always be named as templates can we change it yes of course.
but it required digging up into the settings files digging up into the framework. so it’s most likely that you’re going to be calling up your templates folder always as templates
because that’s what framework is telling you to do so in if somebody next time asks you it’s all about the rules when we have more freedom that means it’s more chances.
that it’s going to be a library when there are more restrictive rules than there are going to be great chances.
That it’s going to be a framework and again who is calling to whom is a great way of getting the sense that what it is it a library or is it a framework if you want to get an example always in your head just remember jQuery and Django or maybe Ruby on Rails or maybe any other such kind of framework.
jQuery is a library and on the other hand, your Django is a framework so there you go finally always remember who is calling whom and you’ll always get the answer that is it a library or framework.
Comments 2