I don't know what the state of the art is, but here's a 6-year-old writeup
of my encounter with interface.pm:

http://www.perlmonks.org/?node_id=379101

On Fri, Aug 12, 2011 at 9:56 AM, Natty <[email protected]> wrote:

> Corrected
>
> On Fri, Aug 12, 2011 at 9:55 AM, Natty <[email protected]> wrote:
>
>> Well, from the definition, an ABC (or ABP in our case..) is a class / pkg
>> which you must inherit from and override the its methods in the subclassed /
>> sub-pkg.
>> So I will not create instances of it nor call its subs directly, I will
>> use it as a design skelton, it will include some real stuff (in the shape of
>> a blessed hash ref), which will be used in the derived pkg's.
>>
>> In C++ for instance (CIAdapter an ABC):
>>
>>  class CIAdapter {
>>  private:
>>    .....
>> public:
>>    virtual void decodeMsg() = 0;
>>    *...*
>>  };
>>
>>  class C3Com : public CIAdapter {
>>  private:
>>    .....
>>  public:
>>    void decodeMsg() { /* implementation */};
>>    *...*
>>  };
>>
>>
>> On Fri, Aug 12, 2011 at 7:11 AM, Gabor Szabo <[email protected]> wrote:
>>
>>> If you are asking, I would be interested to know what does
>>> an Abstract Base Class give if every method of it throws an exception?
>>>
>>>
>>> Gabor
>>>
>>>
>>> On Fri, Aug 12, 2011 at 2:01 AM, Natty <[email protected]> wrote:
>>> > Or should I call it ABP? (Abstract Base Package (-:)
>>> > Anyway , I was wondering what is the best approach to create Abstract
>>> Base
>>> > Classes in Perl?
>>> > I know I can just create a package FOO, squeeze in some methods
>>> (subs..)
>>> > with empty bodies and then override them in any pkg that sub-classes
>>> (with
>>> > @ISA, use parent,etc..) it...
>>> > But I bet there is a better, cleaner way to do this, maybe with
>>> Moose(?)?
>>> > Thanks,
>>> _______________________________________________
>>> Perl mailing list
>>> [email protected]
>>> http://mail.perl.org.il/mailman/listinfo/perl
>>>
>>
>>
>
> _______________________________________________
> Perl mailing list
> [email protected]
> http://mail.perl.org.il/mailman/listinfo/perl
>



-- 
Gaal Yahas <[email protected]>
http://gaal.livejournal.com/
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to