• 0

[Java] Package naming


Question

I've written an app that I'm gonna release soon, but before I do, I have to get the package name right. Right now, I'm using some semi-random name in the com. hierarchy. This is wrong, I know. Here's what I'm thinking (I'm living in Australia):

au.id.<last name>.<first name>.<program name>

What do think? Can you suggest a better name?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
The prefix of a unique package name is always written in all-lowercase ASCII letters and should be one of the top-level domain names, currently com, edu, gov, mil, net, org, or one of the English two-letter codes identifying countries as specified in ISO Standard 3166, 1981.

Subsequent components of the package name vary according to an organization's own internal naming conventions. Such conventions might specify that certain directory name components be division, department, project, machine, or login names.

Thats from the javadocs @ Sun.

So, you could have it as au.<company>.<product>

Link to comment
Share on other sites

  • 0

If you're going to release an app your going to need a web site. For that you should register a domain name related to your product. You should then use your (necessarily unique) domain name with the elements in reverse order as (the start of) the package name.

Eg

web site www.myprogram.com.au, package name au.com.myprogram[.anything else].

This is recommended practice in order to ensure that all published package names are unique worldwide.

http://java.sun.com/docs/books/jls/second_....doc.html#40169

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.