I think you misunderstood my point.  The physical location of a Java package
is separate from its logical name.  The language only exposes the logical
name.  It just happens that the default system class loader maps logical
class names to directory paths.  Other class loaders can translate logical
class names to something else -- a file with the same name as the fully
qualified class name, or an SQL query into a database, or whatever.  For
example, if I move a package from a directory in the classpath and instead
store it in a JAR file, I don't have to change any of the client code, only
the configuration of the JVM.

Ruby on the other hand exposes *both* the logical name of a package/class
*and* the physical location in which the Ruby code defining that class is
stored.  If I change the way I've organised my files I do have to change
client code.  This is an unavoidable artifact of Ruby's dynamic nature.
However, it does mean that clients of a class are more tightly coupled in
Ruby than in Java, because they rely on two unrelated details -- the logical
name of the class and the physical location of the definition of that class.

________________________________
Dr. Nathaniel Pryce
B13media Ltd.
40-41 Whiskin St, London, EC1R 0BP, UK
http://www.b13media.com

XP Day, London, UK. 15th December 2001. http://xpday.xpdeveloper.com/

----- Original Message -----
From: "Sean Russell" <ser / germane-software.com>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>; <undisclosed-recipients: ;>
Sent: Thursday, December 06, 2001 3:33 PM
Subject: [ruby-talk:27694] Re: Package Naming


> Nat Pryce wrote:
>
> > the storage of those packages.  Therefore, in Java, moving a class
between
> > directories or machines, or even organisations, doesn't require any
> > refactoring.  It just requires some configuration changes.
>
> No, you have to go through and change all of the package names of the
> classes that you move, and you have to change the includes of all of the
> files that include that package... unless you use block includes, which is
> also against the recommended style guide.
>
> Also, if you have some products which use classes whose names conflict
> within a single sourcefile, then you have to find all instances of that
> class name and fix the package name.  EG:
>
>   public com.mycompany.math.Vector multiplyVectors( java.util.Vector v ) {
>     // ...
>   }
>
> Thankfully, Java is compiled, and the strong typing catches most of these
> problems.  Ruby is not, and I dread the thought of having to track down
all
> of the bugs that will result from situations like this.
>
> --
> --- SER
>