Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Java SE a framework?

Tags:

java

I want to know is this legitimate to say Java SE a framework? If Java SE is a framework, then why there is a collection framework? Isn't collection framework inside Java SE?

like image 474
Alvin Avatar asked Feb 26 '23 20:02

Alvin


2 Answers

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.

like image 68
Péter Török Avatar answered Mar 01 '23 10:03

Péter Török


No, I wouldn't call Java SE 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.

like image 23
Mirko Stocker Avatar answered Mar 01 '23 11:03

Mirko Stocker