Reputation: 467
When rolling java code I've always stuck to the recommended convention of <reversed domain name>.<internal naming convention>
. Usually this is pretty solid and prevents any issues with naming conflicts down the line. However, when you're dealing with 'deeply sub-domained' organisations - for example cisb.justice.qld.gov.au
- it gets a bit over the top. especially when you add the internal conventions and end up with something like au.gov.qld.justice.cisb.comm.sony.pfm42v1.
etc.
Now I'm assuming that I'm not the only programmer working for the Queensland Government, ditto with the Department of Justice so simplifying to au.gov.qld.
and au.gov.qld.justice.
are out.
What are some of the conventions others have used in similar situations?
Upvotes: 1
Views: 208
Reputation: 467
The approach taken was to utilize au.gov.qld.justice.duet.
as the base package. This adheres to the java standards and references a project name rather than internal department name to prevent any issues with department name shuffles in the future.
Upvotes: 1
Reputation: 719281
I've not heard of any general conventions to deal with this.
If it is a real issue, then you need to talk to other developers within Queensland Justice to figure out a corporate specific convention.
Doesn't Corporate Information Systems Branch (?) set IT policy for Queensland Justice? Can't you just have a word to the policy dude and get him to send out a memo? (Yeah, I know ... life is never that simple ... but it might be worth a try.)
But frankly, cisb.justice.qld.gov.au
is not that "over the top".
Upvotes: 0
Reputation: 25626
Well, yes, obviously au.gov.justice
is out, because that's not part of your domain name backwards. au.gov.justice
would mean Federal Government, not State.
If the obvious choice is too long for you, consider justice.qld.gov.au
or courts.qld.gov.au
.
Whether that's OK will depend on how many other people work for the department, how it's structured, and if there are any policies, but it might be acceptable because you still have the project name to make the package name unique.
Is this the first time this issue has popped up in your department? Maybe somebody else already picked a convention.
Another issue for government departments is that they frequently change names.
Did your department just change names? Maybe you should stick with the old name, or pick something that's likely to still work the next time the name changes.
The Java Language Specification reminds us that the primary purpose of namespaces is to ensure the package name is unique, so provided you start the package name with au.gov.qld
, you might have a small amount of flexibility provided you take steps to ensure the name doesn't clash with another government department.
Upvotes: 0