brian moseley <[EMAIL PROTECTED]> writes:

> you can certainly say "the nth parameter implements
> interface Foo::Bar", and provide Foo/Bar.pod that describes
> the interface, and get the exact same benefit.

Of course.  But you lose nothing by actually making it an ISA
relationship; you don't even lose performance.  Plus you could do
something like this:

sub foo {
  my $self = shift;
  my $bar = shift;

  $self->die_because_of_bad_bar_parameter
    if $DEBUG and not $bar->isa('SomeBase::Class');
  ...
}

You can have the checks in during development, and pull during
production.  It's not 100% efficient, but it's pretty close.  With
some use constant magic, you may even be able to get the compiler to
optimize away the entire line at compile time, resulting not even in a
check on the value of $DEBUG in production environments.

> i question the wisdom of relying on a code-level inheritance
> usage to communicate class relationships. isn't that why we
> use class diagrams and pod?

I don't understand why you would rather not have a very simple base
class that defines the interface, and then have an ISA relationship
with it, instead of simply having several classes with no code level
relationship other than supporting the same method calls.

Chip

-- 
Chip Turner                   [EMAIL PROTECTED]
                              RHN Web Engineer

Reply via email to