What's the rationale behind the javax package? What goes into java and what into javax?
I know a lot of enterprise-y packages are in javax, but so is Swing, the new date and time api (JSR-310) and other J2SE packages.
The javax prefix is used by the Java programming language for a package of standard Java extensions. These include extensions such as javax. servlet, which deals with running servlets, and javax. jcr, which deals with the Java content library. Package, Programming terms.
A package in Java is used to group related classes. Think of it as a folder in a file directory. We use packages to avoid name conflicts, and to write a better maintainable code. Packages are divided into two categories: Built-in Packages (packages from the Java API)
Originally javax
was intended to be for extensions, and sometimes things would be promoted out of javax
into java.
One issue was Netscape (and probably IE) limiting classes that could be in the java package.
When Swing was set to "graduate" to java
from javax
there was sort of a mini-blow up because people realized that they would have to modify all of their imports. Given that backwards compatibility is one of the primary goals of Java they changed their mind.
At that point in time, at least for the community (maybe not for Sun) the whole point of javax
was lost. So now we have some things in javax that probably should be in java
... but aside from the people that chose the package names I don't know if anyone can figure out what the rationale is on a case-by-case basis.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With