Forums Register Login

Why are URLs in package names written in reverse?

+Pie Number of slices to send: Send
The title says it all
+Pie Number of slices to send: Send
It's just a convention. Its not mandatory. But, I'm glad to know more regarding this
+Pie Number of slices to send: Send
I don�t know if this is the official answer, but it just makes sense from a directory standpoint, and as a �drilldown� methodology of taking a larger set, and refining it to a smaller subset. Using this naming convention, when a company or group has multiple packages, you cut down on the number of directories needed:
For example, given the packages:
com.foo.someApp
com.foo.someApp.helperClasses
com.foo.someApp.guiClasses
com.foo.anotherApp
you have


Here you have 6 total directories; if you went the other way:

This results in 14 directories and is a lot more confusing to find things. It is just a nature sorting order to go from the item with the largest quantity to the smallest. Personally, I�ve always felt that it is the URL�s that have it backwards
+Pie Number of slices to send: Send
Hi,
Well, it's a fairly trivial question, and I know it's just a convention, but I'm interested in case there's more than meets the eye.
I don't see why with your example you couldn't have foo as the top directory, followed by com, followed by the various subdirectories.
Ie.,
foo.com.someApp
foo.com.someApp.helperClasses
foo.com.someApp.guiClasses
foo.com.anotherApp
It seems more readable to me. Have I missed something?
J
[ February 25, 2004: Message edited by: joseph corner ]
+Pie Number of slices to send: Send
I always thought the most basic reason for assigning package names as reverse URL domains is that they become unique to the organisation or individual who uses that URL. That way you only have to worry about other people in your organisation writing packages with the same name because no-one else outside your colleagues should be using your URL to name their package.
Reversing it completely does seem the most systematic way of doing it to me as it creates a more pure hierarchy.
+Pie Number of slices to send: Send
joseph
You would have the root of the name in the middle:

This shall be the graph for your naming:
ibm.com.foo.c1;
sun.com.foo.c1;
or standard:
com.ibm.foo.c1;
com.sun.foo.c1;

There are domains like
foo.edu.uk
which lead to:
uk.edu.foo.c1;
but where would you search the net, if it was:
foo.edu.uk.c1;
You might search at the above mentioned place, for c1, or at
foo.edu
for uk.c1;
+Pie Number of slices to send: Send
If you think about it, URLs do, by convention, have the root web address backwards. Look at the URL above...saloon.javaranch.com/cgi-bin/ubb/...
So if you think about it, the pattern the URL follows is <site>/<directory>/<more specific directory>/...it's just that, by convention, the site components are listed in reverse.
sev
I'd appreciate it if you pronounced my name correctly. Pinhead, with a silent "H". Petite ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1835 times.
Similar Threads
incompatibilities in the sun.beans.editors package?
Package names and reverse domain names
simple insert drives me nuts
Why should we import javax.servlet.http.* when we already imported javax.servlet.*?
How can I set the color of the message validation
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:21:03.