6

Possible Duplicate:
What is the difference between a framework and a library?

Java documentation says The collections framework

Why is java collections called a framework and not a library? Now I am more confused about what I can expect from a framework as to a library..

asked Oct 27, 2012 at 4:46
3
  • 1
    Related: stackoverflow.com/q/148747/738746 Commented Oct 27, 2012 at 4:49
  • 4
    Is a cat a predator or a mammal? Now apply the same reasoning to this question! Commented Oct 27, 2012 at 5:16
  • You shouldn't expect different things from a framework and a library. I'd use them nearly synonymously. Commented Oct 27, 2012 at 5:32

1 Answer 1

1

The following characteristics differentiate Frameworks from libraries:

inversion of control - In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not dictated by the caller, but by the framework.

default behavior - A framework has a default behavior. This default behavior must actually be some useful behavior and not a series of no-ops.

extensibility - A framework can be extended by the user usually by selective overriding or specialized by user code providing specific functionality.

non-modifiable framework code - The framework code, in general, is not allowed to be modified. Users can extend the framework, but not modify its code.

Basically a framework is a type of a library whose behavior cannot be changed. For instance, you can extend class ArrayList or HashMap in java, but you cannot change the behavior of those classes.

answered Oct 27, 2012 at 5:52
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.