What is the difference between a class library and a framework

I hear the whole day the terms class library, base class library, Framework, ...
What highlights a framework and what a base class library?


Solution 1:

The distinguishing feature between a class library and a software framework is that in a framework, the flow of control is not determined by the user´s code, but by the framework.

This is also known as Hollywood principle (don´t call us, we call you).

By the way, there is also a nice Wikipedia article on this topic.

Solution 2:

You use a class library in writing your code, but you code within a framework.

The term "framework" is meant to invoke a sense of "being within an environment". If I were to put a (limited) analogy to it, I'd say that a class library is like being able to eat cheese and drink wine, whereas a framework is like visiting France; experiencing the culture. The framework is the structure around which you build your program. The class library are the tools you use (possibly within a framework).

Of course, a framework will typically contain libraries of classes. .NET, for instance, has heaps of class libraries which are included in the entire framework.