Click here to get back home

For module X::Y, should Y be (isa) X?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
For module X::Y, should Y be (isa) X? Steve Roscio 01-10-2008
Posted by Steve Roscio on January 10, 2008, 2:13 pm
Please log in for more thread options
Is it considered bad form to have a module named X::Y, that is not an X?
In otherwords, should Y have a 'use base qw/X/' or an @ISA for X?

I know the language doesn't enforce it, but what's the general concensus
on this?

Thanx,
- Steve

Posted by Big and Blue on January 10, 2008, 4:08 pm
Please log in for more thread options
Steve Roscio wrote:
> Is it considered bad form to have a module named X::Y, that is not an X?
> In otherwords, should Y have a 'use base qw/X/' or an @ISA for X?
>
> I know the language doesn't enforce it, but what's the general concensus
> on this?

X is a namespace. It may not be an object-producing module (or even a
module) at all.

I certainly have X::Y objects where X doesn't exist in Perl - it just
exists in the file system to separate my modules from others.


--
Just because I've written it doesn't mean that
either you or I have to believe it.

Posted by Peter J. Holzer on January 11, 2008, 4:21 pm
Please log in for more thread options
> Is it considered bad form to have a module named X::Y, that is not an X?
> In otherwords, should Y have a 'use base qw/X/' or an @ISA for X?
>
> I know the language doesn't enforce it, but what's the general concensus
> on this?

I don't think that X::Y should generally be a subclass of X. They
should be somehow related, of course, but the relationship can be
anything, "has a" seems to be a lot more common than "is a" in my code.

        hp

Posted by Steve Roscio on January 11, 2008, 5:32 pm
Please log in for more thread options
thanx guys - I appreciate the insight!

Similar ThreadsPosted
Lower case module name for non-pragma module January 4, 2005, 10:19 am
RFC: New module 'Module::Bundled::Files' August 26, 2005, 3:49 pm
help with an MD5.pm module!! September 3, 2005, 11:39 pm
Looking for RTP module December 9, 2004, 9:17 pm
module for FFT May 9, 2005, 3:06 pm
Module may not be right one? April 27, 2006, 12:57 pm
The 'if' module June 1, 2006, 8:18 pm
The 'if' module June 1, 2006, 8:26 pm
use module March 3, 2007, 5:13 am
Name my Module! July 27, 2007, 6:46 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap