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

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

am 10.01.2008 20:13:22 von Steve Roscio

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

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

am 10.01.2008 22:08:21 von Big and Blue

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.

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

am 11.01.2008 22:21:20 von hjp-usenet2

On 2008-01-10 19:13, 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?

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

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

am 11.01.2008 23:32:55 von Steve Roscio

thanx guys - I appreciate the insight!