views:

51

answers:

2

The convention is that you use your company's domain. That is quite simple but what if it is something like www.mycompany.co.uk.

Now this wouldn't be a problem if it were www.mycompany.com. That is fairly simple com.mycompany.Class

What are we meant to do with the first?

uk.co.mycompany.Class OR co.uk.mycompany.Class? Or something else altogether?

+6  A: 

uk.co.mycompany.Class

It is a simple reverse of your URL. Note that in the first example the domain you actually own is mycompany.com, not just www.mycompany.com

Guvante
sorry yes. Little slip. The other irritating thing is that it adds ANOTHER folder to browse through if you are using Java. Maybe placing them together, couk.mycompany?
uriDium
In reality, unless you are releasing the product as something that has the possibility of namespace collision (SDK, developer library, Android) there is little true need to stick to the standard.
Guvante
@quiDium: "adds ANOTHER folder to browse through" Just use a decent IDE, which will present packages as a reasonable structure :-). Eclipse e.g. does this (Package view).
sleske
A: 

If that is how your supposed to write your namespaces, I'd say that uk.co.mycompany.Class fits best with your first example.

It also seems to me that this is pretty subjective, and you should define a standard, and stick with it.

Nate Bross
FYI Java's official recommendations are to use the inverse of the company's URL for namespaces. A bit odd but it means fewer collisions in the wild.
Mr. Shiny and New