| Author |
why collection API is called as framework
|
ramesh maredu
Ranch Hand
Joined: Mar 15, 2008
Posts: 210
|
|
I faced this interesting question in an interview.
We have several packages in java like lang, io etc, but why util package is called as framework (collection framework)?
|
SCJP 1.5 94%.
The greatest glory in living lies not in never falling, but in rising every time we fall.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12929
|
|
That's really a question of definition of words, not really a technical Java knowledge question.
One reason I would think of is that the collections interfaces and classes are meant to be extended: they were designed in such a way that you can create your own special collection classes by implementing and extending the interfaces and classes of the Java collections API - in contrast to classes in other packages, which are just meant to be used (and not extended via inheritance).
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
|
@Jesper: I agree with you however I hardly ever extend the collection classes. Mainly because almost everything data-structure you would commonly need is already built.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Nico Van Brandt
Ranch Hand
Joined: Mar 31, 2011
Posts: 66
|
|
|
A framework is a reusable collection of classes and interfaces so pure theoretically it's correct to call it a framework.
|
Oracle Java SE6 Certified Programmer
Oracle Java EE5 Certified Web Component Developer
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12929
|
|
|
That's true Wouter, usually you would just use the standard ArrayList or HashMap, for example, but I guess it's about the principle - the interfaces and classes in the collections API are designed to be extensible, while many of the other standard Java classes are not designed to be extended (in fact, many of them are final, so that you can't extend them).
|
 |
 |
|
|
subject: why collection API is called as framework
|
|
|