Title: RE: Name for GStreamer bindings

> > If all modules have really short names then nobody knows
> when anybody
> > else's modules are for, which rather defeats the purpose of
> Cpan.  Cpan
> > is a global namespace, and as such names have to be chosen
> carefully to
> > be as meaningful as possible to people who don't share the author's
> > context.
>
> Yeah, I agree.  That's why I like Mark's proposal of using
> aliased.pm to
> alias something like Media::GStreamer to Gst.
>
> > > I need something that is easy and fast to type.
> >
> > Why?  I can see why you'd _like_ something that's less to
> type, but why
> > is there a need that applies to this module rather than
> other modules.
> > You only have to type the module name in the use line and
> in any class
> > methods, often just a constructor.
>
> I tried to explain that in my original mail.  The GStreamer bindings,
> just like Gtk2 or Gnome2, are different.  You don't just use one
> constructor once.  Typical applications will have to create many
> Gst::Element's, a few Gst::Structure's, some Gst::Index's,
> Gst::Caps's,
> a Gst::Clock, etc., etc.  Try imagining how long this
> paragraph would be
> if I used Multimedia::GStreamer as the namespace.

Export a constant Gst() that equals Multimedia::Gstreamer.

Ie the moral equivelent of

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

  Gst->new(....);

Or make a factory sub:

sub GstNew {
  my $class="Multimeadia::Gstreamer::".shift(@_);
  return $class->new(@_);
}

And also possibly a clone method:

my $elem=GstNew("Clock");
my $other_elem=$elem->clone();


Yves

Reply via email to