You, might have listened about these three terms frequently.
Do you know the basic difference between these three terms or where and when to use the these words?
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.
A library is just a collection of class definitions. It is a reusable piece of code which you use as it comes. A library will usually focus on a single piece of functionality, which you access through an API. You call a library function, it executes some code and then control is returned to your code.
For example, there are some libraries of mathematics which can let developer just call the function without redo the implementation of how an algorithm works.
A framework is a piece of code which dictates the architecture your project will follow. Once you choose a framework to work with, you have to follow the framework’s code and design methodologies. The framework will provide you with hooks and callbacks, so that you build on it – it will then call your plugged-in code whenever it wishes, a phenomenon called Inversion of Control.
Framework is just like a skeleton on which there is a flesh(our code).
A framework will usually include a lot of libraries to make your work easier. Examples of (web) frameworks are:
- Ruby on Rails
- Tornado Web
Platform is home for other frameworks. Framework are in turn home for end apps.
e.g.: C is programming language and platform for modern languages like CPP,Java etc.