Ask a Question related to PERL Modules, Design and Development.
-
TTK Ciar #1
Naming modules from the Internet Archive
Hello! My name is TTK Ciar, and I am a software engineer at the
Internet Archive.
In the Data Repository and Collections departments we have some
perl modules which we use in a lot of our software, which might be
of more general interest. I would like to clean up and document
these and publish them to CPAN.
My main question involves the module namespaces. Right now we have
things set up so all of our data clusters' servers have a /petabox
directory, and our in-house modules heirarchy is stored in
/petabox/sw/modules. Our scripts "use lib '/petabox/sw/modules'"
explicitly to use these modules, for instance:
#!/usr/bin/perl
use lib '/petabox/sw/modules';
use DR;
use DR::Ctl;
use DR::ItemTracker;
use Database::UniversalDB;
From the perspective of someone who uses these modules a lot, it
would be really nice if we could just have our own module namespace,
like "Cluster::InternetArchive", and then replicate the heirarchy
currently in /petabox/sw/module into Cluster::InternetArchive, such
that the above code fragment would turn into:
#!/usr/bin/perl
use Cluster::InternetArchive::DR;
use Cluster::InternetArchive::DR::Ctl;
use Cluster::InternetArchive::DR::ItemTracker;
use Cluster::InternetArchive::Database::UniversalDB;
This would make things convenient for *us* in a variety of ways
(and especially easy for me in particular) :-) but would it be what
the larger Perl community wants? Should I instead plan on tucking
each of our various modules under the module namespaces most closely
related to their function? For instance: App::Ctl, Db::UniversalDB.
An added spin to the issue is that many of these modules contain
functions which assume that the cluster environment is set up in
the "Archive Way" (things like ssh configured to run without
passwords, mountpoints and rsync modules following our naming
conventions, large persistent /tmp filesystems, and so on), though
many of these functions will operate fine in alien environments.
It would be handy if institutions which have configured their
clusters like ours could simply "install Cluster::InternetArchive"
and have all of the modules which are written to those conventions
installed.
I thought Cluster::InternetArchive might be appropriate because
most of these functions are cluster-centric, and the current
Cluster namespace seems underutilized, but on the other hand the
00modlist.long.html document asks: "Please avoid using more than
one level of nesting for module names (packages or classes within
modules can, of course, use any number)". So would dropping the
"Cluster::" and just going with "InternetArchive::" be the right
thing to do, in light of this? Or the other way around, dropping
"InternetArchive::" and putting them under "Cluster::"? Or would
it be better to scatter these modules across multiple existing
module heirarchies?
What's the right thing to do?
Thanks in advance,
-- TTK
TTK Ciar Guest
-
Module naming help
I have written 2 modules which I intend to upload to CPAN. I have chosen the names "Class::MethodVars" and "Class::Framework", they would both be... -
thoughts on modules naming
I'm planning a module to provide a binding to a graphing library called igraph . I originally chose Graph::LibIgraph as the name, but it was... -
Var naming S.O.S
Hi, I am desperatly trying ton use concatenation in variables naming. Say i have : var nb = 5; I would like to use the value of nb in a... -
Prove internet package for Microsoft Internet Explorer
Grow up little nerdy boy. Infecting people's machines is so passé, so why not do something productive like invade North Korea. Tony.



Reply With Quote

