The key difference between Library and Framework is in IoC (Inversion of Control)
- by using a feature from a Library you are in control.
- The Framework include some abstract design with built-in behaviors. Control is inverted and the framework calls you; framework code will call the code at those various points that behavior has inserted. The Hollywood principle: Don’t call Us, we’ll call You.
|A certain set of reusable functions of an application (mostly organized into classes)||As a skeleton of an application|
|A collection of class definitions||A collection of patterns|
|You call the library APIs in your code||A framework calls your code|
|The control is always with you||The control in with the framework if you’re using it|
|Libraries meant to do some specific tasks only||Framework is a predefined design|
|You need to scaffold your project manually||Super easy to scaffold|
One thought on “Library vs Framework”