I own a .co.uk domain, and I whenever I’ve dealt with Java-style package naming, I’ve gone with uk.co.domainname
. Once I encountered package that did the following: co.uk.domainname
.
Is one of these right, or is it something that’s up to the developer’s discretion? Is there some sort of convention that deals with this?
0
There’s no real rule here, just the conventions that Sun created with the com.sun.* packagers. The only real requirement is uniqueness and that the co.uk… convention defines a folder/file structure.
What will be the decider in your case is what name you want for a ‘root’ folder – ‘uk’ or ‘co’?
3
Java tutorials make it pretty clear that you should use the inverse of your domain name, e.g. uk.co.domainname
. If you mix it up and go with co.uk.domainname
then you run the risk of someone with the site http://uk.co clashing with your package naming structure. While unlikely, you may as well stick to the standards and rule any potential clash out.