|
||
|
Packaging Java classes
Naming Java packages
Java package names are identifiers and therefore are subjected to the same limitations imposed on naming classes,
variables, methods, etc. Although
this still gives you lots of freedom when naming packages, there is a package-naming scheme promoted by Sun to which you should consider adhering.
Sun's naming scheme involves using the domain name of your Web site as the beginning of a package name, followed by more descriptive names that describe the set of classes you are packaging. The purpose of this scheme is to help assure that all Java classes are uniquely identified. The domain name of my Web site is thetribe.com, so a package containing my own custom animation classes might be named com.thetribe.animation. Placing my animation classes in this package guarantees uniqueness because the domain name thetribe.com is not used by anyone else. Of course, you may not even have a domain name or you may be developing classes for use in a stand-alone Java application that has no association with the Internet. In this case, the naming of your packages is less of an issue. |
||
|
|
||