tags:

views:

135

answers:

3

Hello,

I want to know is this legitimate to say J2SE a framework? If J2SE is a framework, then why there is a collection framework? Isn't collection framework inside J2SE? Please help me!

+3  A: 

No, J2SE (now JavaSE) is not (just) a framework. It is a development and runtime environment, which contains several libraries / frameworks, among others the collection framework.

The terms framework and library are AFAIK fairly loosely defined. A library (in OO languages) is a bunch of interfaces and classes organized around a common goal and/or abstraction, suitable for specific task(s).

A framework is a library which is typically oriented towards making application development simpler by implementing the common "skeleton" of related tasks. A typical feature of frameworks is the inversion of control. E.g. most GUI frameworks I know of manage the initialization / shutdown of the app, the message passing etc. themselves, allowing (and expecting) you to define and hook up callback methods to deal with specific tasks, e.g. opening a document, handling a specific event etc. Your code is always called from within the framework code, and not vice versa as is with libraries in general.

So in this sense the Collection Framework is not well named - it should be called a library instead.

Péter Török
+2  A: 

No, I wouldn't call J2SE a framework. If you take a look at its website, it's described as a "complete environment for application development and deployment". A framework on the other hand is some kind of abstraction you program against.

I also don't think that the collections are a good example for a framework, because you usually use them just as a library.

Mirko Stocker
+1  A: 

Take a look at: http://www.hildeberto.com/2008/10/platform-versus-framework_12.html

XnS