Library Vs Framework

Spread the love

A library is a reusable piece of code which you use as it comes i.e it does not provide any hooks for you to extend it. 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. An example of a good Java library (or libraries in this case) is Apache Commons:

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.




Leave a Reply