Take the 2-minute tour ×

What are the advantages of using Framework over Library or other way around while developing Web Applications or different types of Software.

I understand using Framework we can make use of basic functionality and then add upon functionality which we require but I am having hard time understanding the advantages of it as if we develop using Library than also we get some basic functionality and then add upon them the functionality as we need and so where in comes the actual advantages of using Framework.

share|improve this question
Typically every application will use one or more frameworks and libraries. Usually "frameworks" imply that you are working within a certain paradigm, while "libraries" are usually feature-oriented, but it's really just a matter of perspective and structure. I think you need to express this question far better to get any useful answers. –  Cade Roux Mar 7 '10 at 15:36

2 Answers 2

up vote 2 down vote accepted

I think it's important to distinguish between a framework and a library when answering.

A framework follows the Hollywood principle: "Don't call us; we'll call you." You plug your code into the framework according to its API. The framework acts as a constraint that solves the particular problem it was designed to solve (e.g., web application development).

A framework will use a combination of your code and 3rd party libraries to solve a particular problem. It will treat your code as one of those 3rd party libraries.

If you eschew a framework, the roles are reversed. Now you and your code are in charge: "I'll do the calling, thank you." A library is a self-contained piece that plugs into the software that you write.

So why prefer a framework? Use one that is written better than the scaffolding that you would be able to write yourself. A framework is likely to be tested more thoroughly and have a wider user base than code you'll write.

You'd write an application without a framework if you're working on a specialized problem, you have deep knowledge of the domain, and there are no frameworks available that demonstrate deeper insight than you have.

share|improve this answer
This is the first time I have come across the "Hollywood principle", an excellent metaphor! –  Jamie Chapman May 15 '10 at 21:19

A library is just something that solves a problem but it is your job to integrate it the project. Basically it offers some feature that are context-free.

A framework will provide the features plus an infrastructure for them - you will have to develop according to the framework's rules. So you might have less control and freedom but you save time.

share|improve this answer

Your Answer


