Unix and Linux Discussions Tagged with implement |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
4,847 |
UNIX for Advanced & Expert Users |
|
|
|
14 |
9,743 |
Solaris |
|
|
|
0 |
5,070 |
Shell Programming and Scripting |
|
|
|
1 |
5,922 |
AIX |
|
|
|
3 |
2,152 |
Shell Programming and Scripting |
|
|
|
2 |
2,059 |
Shell Programming and Scripting |
|
|
|
2 |
2,803 |
Shell Programming and Scripting |
|
|
|
1 |
2,247 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
3,187 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
3,437 |
Programming |
|
|
|
4 |
11,950 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
6,920 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
11,339 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,263 |
Programming |
|
|
|
2 |
6,149 |
IP Networking |
|
|
|
2 |
3,584 |
Programming |
|
|
|
1 |
4,265 |
Programming |
|
|
|
1 |
5,115 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
9,900 |
Programming |
|
|
|
1 |
7,171 |
Cybersecurity |
Class::Virtually::Abstract(3pm) User Contributed Perl Documentation Class::Virtually::Abstract(3pm)
NAME
Class::Virtually::Abstract - Compile-time enforcement of Class::Virtual
SYNOPSIS
package 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;
DESCRIPTION
This 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().
AUTHOR
Original 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 ALSO
Class::Virtual
perl v5.10.1 2007-10-23 Class::Virtually::Abstract(3pm)