PDA

View Full Version : Package name



sacolcor
Apr 27th, '03, 08:10 PM
A curiosity question from a journeyman Java programmer: I notice that the heromaker objects look like they're in the com.hero space. By convention, shouldn't they be in the com.herogames space instead?

Simon
Apr 28th, '03, 03:24 AM
Not really....for the same reason that Sun Microsystem's classes are generally found in com.sun.*

sacolcor
Apr 28th, '03, 06:52 AM
...but Sun Microsystems owns the sun.com domain. Hero games doesn't own hero.com; that's owned by "Hero Consulting". The java convention at http://java.sun.com/docs/books/tutorial/java/interpack/createpkgs.html suggests using the company's internet domain (reversed). Otherwise, Heromaker's objects could conflict with those made by Hero Consulting (unlikely, but it looks like they're a web design company, so it could happen).

Simon
Apr 28th, '03, 07:15 AM
It's meaningless in this case, as the packages that are created for HD are not part of a public API. The package naming conventions only apply when delaing with publicly released APIs that others can use. Since the APIs for HD are not public, no one can use them (other than me), which means that there really isn't the possibility for a conflict.