demerphq has asked for the wisdom of the Perl Monks concerning the following question:

Hello all,

I am curious as to the current state of thinking regarding the Tie:: namespace.

On the modulelist most ties seem to named 'naturally' according to their function such as

Tie::IxHash or Tie:SubstrHash
Whereas the less natural but more OOish might have been
Tie::Hash::Indexed (Tie::Hash::Ix??) and Tie::Hash::Substr
(personally I might even suggest restructuring the Tie:: namespace into their components and keeping stubs that use the @ISA relationship to refer to the reorganized classes. I _might_ suggest this because as people contribute more and more tie classes the flat nature of the namespace is going to get quite polluted indeed, I *won't* of course because suggesting such a thing would get me lynched...) (Oops! :-)

Now my question is for a new Tie that I am about to submit to cpan should I go along with the former or the later scheme?

FYI: The module I want to submit is a hash implemented using tries, similer to Tree::Trie (actually mine impleements Tree::Trie as well) but with a tie interface as well as an OO interface. So should this be called Tie::TrieHash or Tie::Hash::Trie My personal 'gut' feeling is that the latter makes more sense, but I would appreciate any thoughts on the matter from anyone out there.

Yves

--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)

Replies are listed 'Best First'.
Re: How to choose a Tie:: 's name
by davorg (Chancellor) on Sep 03, 2001 at 16:51 UTC

    Before uploading any modules to CPAN it's worth checking the naming conventions with the gods at the module@perl.org mailing list.

    My personal preference (and I have three Tie::X modules on CPAN) is to use a system like Tie::Type::Description, where Tie indicates that it's a tied object, Type gives the type of Perl variable that you tie the object to (e.g. Hash) and Description is a brief indication of what the module does. Examples of this kind of module are Tie::Hash::Regex, Tie::Hash::Approx, Tie::Scalar::HalfLife and Tie::Scalat::TimeOut.

    --
    <http://www.dave.org.uk>

    Perl Training in the UK <http://www.iterative-software.com>