From: Eivind Eklund Date: 2006-01-06T20:31:16+09:00 Subject: Re: What's the best practise in naming modules? On 1/6/06, Henrik Martensson wrote: > I am working on a module for unit testing XML documents (and document > fragments). It would be logical, I think, to name the module > Test::Unit::XML, and to load it using "require 'test/unit/xml'". > > However, this naming scheme could cause problems. For example, if the > core unit test package is extended with assertions for testing XML. > Also, even if my xml.rb file is physically separate from the files in > the core test/unit directory, I don't feel comfortable with the possible > overlap in names. > > I could of course change the names: > > XML::Test::Unit > require 'xml/test/unit' > > or I could do something like this: > > Test::Unit::XML > require 'testunitxml' > > However, I neither of these alternatives is as appealing. > > What is the recommended Ruby practise in these cases? First of all, I'd coordinate this with Nathaniel (author of Test::Unit, nathaniel@talbott.ws). Second, I'd call it something complete different - a unique name, totally off the Test::Unit namespace, until it has lived for a while with different people using it. If it seems like a good idea *then*, I'd rename it into Test::Unit::XML (again, after coordinating with Nathaniel). The delay is to make sure that the design is sound, that you don't find a better and incompatible way to test shortly after, and have taken the main namespace. That namespace should be for something that's fairly permanent. Eivind.