Java package: Difference between revisions

Content deleted Content added
Shadanan (talk | contribs)
No edit summary
Expanded on discussion of package naming conventions
Line 44:
== Package naming conventions ==
 
One of the primary purposes of the package naming conventions is to avoid the possibility of two published packages having the same name by choosing unique package names for packages that are widely distributed. This allows packages to be easily and automatically installed and catalogued.
In general, a package name begins with the [[top level ___domain]] name of the organization and then the organization's ___domain. The organization can then choose a specific name for their pacakge. Package names should be all lowercase characters whenever possible.
 
In general, a package name begins with the [[top level ___domain]] name of the organization and then the organization's ___domain and then any subdomains listed in reverse order. The organization can then choose a specific name for their pacakge. Package names should be all lowercase characters whenever possible.
For example, if an organization in Canada called MySoft creates a package to deal with Fractions, they might name their package:
ca.mysoft.fractions
 
For example, if an organization in Canada called MySoft creates a package to deal with Fractionsfractions, they might name their package: <tt>ca.mysoft.fractions</tt>
== Packages in J2SE 1.5 ==
 
Complete conventions for disambiguating package names and rules for naming packages when the Internet ___domain name cannot be directly used as a package name are described in [http://java.sun.com/docs/books/jls/third_edition/html/packages.html#7.7 section 7.7] of the [http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html Java Language Specification].
 
== PackagesCore packages in J2SE 1.5.0 ==
 
* {{Javadoc:SE|package=java.lang|java/lang}}, {{Javadoc:SE|package=java.util|java/util}}: These package hierarchies provide basic language functionality like types, [[regular expression]]s, the Reflection API
Line 68 ⟶ 71:
 
* {{Javadoc:SE}}
* Java Package Naming Conventions [http://java.sun.com/docs/codeconvbooks/jls/third_edition/html/CodeConventions.doc8packages.html#7.7 Java Language Specification, 3rd edition: Unique Package Names]
* [http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html Java Package Naming Conventions]
 
{{compu-lang-stub}}