Torsten Schoenfeld wrote:
On Fri, 2005-02-25 at 09:43 +0100, A. Pagaltzis wrote:


 use constant Gst=>'Multimedia::Gstreamer';

Gst->new(....);

I just realized that this won't work. I don't just need Gst to be an alias for Media::GStreamer, I need Gst::* to be an alias for Media::GStreamer::*. That also seems to rule out the aliased.pm approach.

Why? Sure, you need many constants, not just one, but does that matter?


No, not really.  It seems a bit cumbersome, but I guess it would work.


Something that doesn't seem to have come up in debate here is
that the distribution and main module namespace need not dictate
the package names for classes. You could well stick everything in
Gst:: even though your modules are called Media::GStreamer(::.*)?.


This sounds very evil, but might actually work!  This would solve the
problem in a pretty elegant way:  No top-level CPAN pollution, but a
usable namespace.


Is this a bad idea even if it's clearly documentent?


That's the question. What do others think?

I'd consider it a very bad practice. Imagine if many authors started doing the same. There could be unpredictable collisions all over the place. It defeats the CPAN scheme for ensuring unique namespaces.


I still don't see the problem of using a proper namespace. Arguments of length are not compelling. What's wrong with a descriptive name? The name Gst means nothing to most people. It's fortunate that not all authors have the view that modules interfaced to external libs get their own TLN. There are some bad examples out there, but for each there is a good counter example, eg XML::LibXML.

Randy.

Reply via email to