NAME

dtRdr::Traits::Class - shared OO stuff

SYNOPSIS

Methods to Break Things

NOT_IMPLEMENTED

Imported into base class. Gives a nicer message than the standard "Can't locate method...", indicating that you did not typo the method name, but instead forgot to override it.

sub virtual_method {my $self = shift; $self->NOT_IMPLEMENTED(@_);}

Is the shorter, less readable version worthwhile?

sub virtual_method { $_[0]->NOT_IMPLEMENTED(@_[1..$#_]);}

This should be safe for subclasses to override and/or call as ->SUPER::. This gives you something like an AUTOLOAD (though you would have to get (caller(1))[3] yourself) without having to also do can(), but that's untested...

WARN_NOT_IMPLEMENTED

Same as NOT_IMPLEMENTED(), but just a warning. Returns undef.

$self->WARN_NOT_IMPLEMENTED;

Class Hopping

claim

Assumes a hash-based object. Creates a copy (with only one level of dereference) and blesses it into Package.

$object = Package->claim($object);

AUTHOR

Eric Wilhelm <ewilhelm at cpan dot org>

http://scratchcomputing.com/

COPYRIGHT

Copyright (C) 2006 Eric L. Wilhelm and OSoft, All Rights Reserved.

NO WARRANTY

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

LICENSE

The dotReader(TM) is OSI Certified Open Source Software licensed under the GNU General Public License (GPL) Version 2, June 1991. Non-encrypted and encrypted packages are usable in connection with the dotReader(TM). The ability to create, edit, or otherwise modify content of such encrypted packages is self-contained within the packages, and NOT provided by the dotReader(TM), and is addressed in a separate commercial license.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.