From: "Thomas R. Corbin" Date: 2001-12-06T03:24:54+09:00 Subject: [ruby-talk:27584] Re: Package Naming Rich Kilmer wrote: > > >> -----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' I like this. > > And the module names(space) being based on the subject hierarchy: > > module Text > module Markup > module XML > module REXML > ... > end > end > end > end Someone posted about this, they had a simple scheme to keep this from getting so deep. For all I know it was in this thread, I'm getting so confused, reading so many ruby news articles today. > > ..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". Nice! > > -Rich