Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jonasbn (1153)

jonasbn
  reversethis-{gro.napc} {ta} {nbsanoj}
http://e-diot.dk/
AOL IM: BJonasN (Add Buddy, Send Message)

Perl Programmer located in Copenhagen, Denmark. Active member of Copenhagen Perl Mongers.

Author of:

  • Business::DK::CPR
  • Business::DK::CVR
  • Business::DK::PO
  • Business::OnlinePayment::CashCow
  • Date::Holidays
  • Date::Holidays::Abstract
  • Date::Holidays::Super
  • Date::Pregnancy
  • Games::Bingo
  • Games::Bingo::Bot
  • Games::Bingo::Print
  • Module::Info::File
  • Module::Template::Setup
  • Test::Timer

and maintainer of:

  • Tie::Tools
  • XML::Conf
  • Workflow

Journal of jonasbn (1153)

Friday August 15, 2003
02:24 AM

CPAN/@ISA and inheriting modules and namespace

[ #14134 ]

At YAPC::Europe I heard a presentation by Mark-Jason Dominus (mjd/MJD). He stated that he would like to see more modules on CPAN that inherited from other modules on CPAN.

Since I am that kind of module builder and it gives me great opportunity to create some of the modules which I find useful. Well I am thinking whether this would require a module (package/class) namespace rule so you could easily see that a given module was a child class of another.

There are currently many "wrapper" modules on CPAN and many of them are modules inheriting from other modules. Some of these follow the naming convention *::Simple and the *::Lite namespace seem also to be growing.

So maybe what I am asking has already been decided, so the ::Lite and *::Simple surnames indicate that we are inheriting some given module.

But what happens when we start inheriting from these modules, will we end up with: *::Simple::Lite and *::Simple::Simple?

Well also this problem seem to have taken care of itself, apparently *::Simple::* and *::Lite::* seem to be quite controlled namespaces. I only found one weird one: Bot::BasicBot::Pluggable::Module::SimpleBlog::Store::SQLite, this one has the words Basic, Simple and Lite in its name - it must be easy to use?

At the same time you have the inheriting modules which do not use the naming conventions of *::Simple and *::Lite?

I guess that the way it works for now is ok, CPAN works and it grows...

The last problem is the modules which are not inheritable - now THEY are annoying ;)

Well I better stop these ramblings and go back to work...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I think I'd only want the Lite/Simple ones to be modules that provide simplified interfaces. There are other uses for subclasses (e.g. Email::Thread [cpan.org] [which, in an ironic twist, doesn't subclass a ::Simple, but subclasses another module to let that other module use Email::Simple).

    WWW::Mechanize is another great example of subclass, though I do, at times, wonder if it should in fact be delegating.
    --
      ---ict / Spoon
  • I just wanted to add, that we shouldn't discriminate against different ways of code reuse. Perl's TMTOWTDI way of handling objects often makes delegation a much better way to "inherit" functionality, because you don't need to know about the innards of your super class (and you don't care if they change.)