Bob Showalter wrote:
Michael Kraus wrote:
> "A class that cannot have direct instances. The opposite of an
> abstract class is a concrete class."

Your class is not an abstract class in this sense, as you can
instantiate objects of the class. This is the meaning that I have
always used (coming from C++).

To clarify, of course with Perl you can always instantiate objects of the class. I should have said that an abstract class lacks an *implementation* of the method in this definition.


Example:

  package Abstract;

  sub new {
      my $self = bless {}, shift;
      $self->foo();
  }

  package Concrete;

  @ISA = qw(Abstract);

  sub foo {
      my $self = shift;
      $self->{foo} = 'Hello';
  }

  package main;

  $obj1 = Concrete->new();    # OK
  $obj2 = Abstract->new();    # Not OK


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to