in reply to Dealing with abstract methods in Perl 5.8
I too am interested in making interface style classes more automated. I'm not a big fan of stuffing things in UNIVERSAL however.
If it were me implementing this, I'd make the Attribute::Abstract module the super class of the interface modules like so:
use Attribute::Abstract; BEGIN { our @ISA = qw[Attribute::Abstract]; }
That way you don't need to stuff anything into UNIVERSAL. Then, in Attribute::Abstract, I'd register all modules that use() it (via inheritance of an import()) and check their @ISA for Attribute::Abstract and cause death at compile time for non-overidden methods.
Of course this is all 100% conjecture. I'm not sure if it's possible, etc. But it's the direction I would go in if posed this particular problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dealing with abstract methods in Perl 5.8
by glasswalk3r (Friar) on Apr 25, 2007 at 13:28 UTC |