From: Mark Hahn Date: 2001-12-06T03:33:00+09:00 Subject: [ruby-talk:27586] Re: Package Naming I don't think anyone is arguing for the path matching the name requirement. It is sometimes a nice convention, but it shouldn't be forced on anyone. ----- Original Message ----- From: "Rich Kilmer" To: "ruby-talk ML" Sent: Wednesday, December 05, 2001 9:50 AM Subject: [ruby-talk:27577] Re: Package Naming > > > > -----Original Message----- > > From: Thomas R. Corbin [mailto:tc@clark.net] > > Sent: Wednesday, December 05, 2001 12:05 PM > > To: ruby-talk ML; undisclosed-recipients: > > Subject: [ruby-talk:27568] RE: Package Naming > > > > > > Mark Hahn wrote: > > > > > > > > I like java's dot-com convention. It absolutely guarantees no name > > > clashes. > > > > I like it too. sometimes it seems clumsy, but then any > > hierarchy can have > > it's disadvantages. > > > > Here is my problem with Java's packaging structure: > > file paths==namespace paths > or > com.blah.packagex.classy == com/blah/packagex/classy.class > > I think it IMPORTANT that we maintain a seperation between > file/paths and namespaces (which Ruby does right now). > > require 'patha/pathb/filex' > > can have ANY module namespace in it. > > I think a combination of the file paths being based on a domain/other model: > > require 'com/domain/file.rb' > > And the module names(space) being based on the subject hierarchy: > > module Text > module Markup > module XML > module REXML > ... > end > end > end > end > > ...could then be loaded (for example) > > require 'com/sean-russell/rexml.rb' > > ...and "aliased" like this for ease of use. > > REXML = Text::Markup::XML::REXML > > p = REXML::Parser.new(file) > > Going further I would have a convention where the library creator creates an > 'include' file "com/sean-russell/rexml.rb" that require'd the appropriate > files from "com/sean-russell/rexml/xxx.rb". So if Sean were to create > and additional library "com/sean-russell/wsdl/..." he would also have an > 'include' named "com/sean-russell/wsdl.rb". > > -Rich >