Query: class::virtually::abstract
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Class::Virtually::Abstract(3pm) User Contributed Perl Documentation Class::Virtually::Abstract(3pm)NAMEClass::Virtually::Abstract - Compile-time enforcement of Class::VirtualSYNOPSISpackage My::Virtual::Idaho; use base qw(Class::Virtually::Abstract); __PACKAGE__->virtual_methods(qw(new foo bar this that)); package My::Private::Idaho; use base qw(My::Virtual::Idaho); sub new { ... } sub foo { ... } sub bar { ... } sub this { ... } # oops, forgot to implement that()!! Whatever will happen?! # Meanwhile, in another piece of code! # KA-BLAM! My::Private::Idaho fails to compile because it didn't # fully implement My::Virtual::Idaho. use My::Private::Idaho;DESCRIPTIONThis subclass of Class::Virtual provides compile-time enforcement. That means subclasses of your virtual class are required to implement all virtual methods or else it will not compile. BUGS and CAVEATS Because this relies on import() it is important that your classes are used instead of required. This is a problem, and I'm trying to figure a way around it. Also, if a subclass defines its own import() routine (I've done it) Class::Virtually::Abstract's compile-time checking is defeated. Got to think of a better way to do this besides import().AUTHOROriginal idea and code from Ben Tilly's AbstractClass http://www.perlmonks.org/index.pl?node_id=44300&lastnode_id=45341 Embraced and Extended by Michael G Schwern <schwern@pobox.com>SEE ALSOClass::Virtual perl v5.10.1 2007-10-23 Class::Virtually::Abstract(3pm)
Related Man Pages |
---|
class::whitehole(3) - suse |
class::accessor::fast5.18(3) - mojave |
class::accessor::fast(3) - osx |
class::accessor::fast(3pm) - debian |
class::virtually::abstract(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
while vc++6 succeeds, g++ fails. ??? |
Command for identifying Virtual Machine |
Is there any Virtual data center as we have Virtual Machine? |
Physical or Virtual |
Connecting system to Virtual HMC |