So we can generally describe the working of a library as
- We call the library functions from from our code
- Flow Control is with our code
For example when using JQuery library, we include the library in our code and call the library functions from within our code in the following way
A framework provides structure,resources for building your application.While using a framework you call your logic from within the framework .The control is with the framework code , your code is called when logic is needed and the control is inverted back to the framework .This is called inversion of control / Hollywood principle(“Don’t call us, we’ll call you).
So we can generally describe working with a framework as
- We call to our code from framework
- Flow Control is with the framework.When needed our logic is applied and control goes back to the framework.
We look at the working of a framework taking AngularJS as an example. While building an AngularJS application,the framework gives the routing methods for our application.When it has to render a view it calls for our bit of code.
Remember,the framework may or may not use multiple libraries depending upon your choice of framework.Most framework makes use of many libraries.