The chained SUPER::add_resources calls are fine, but why are you overriding new if all you do is return $class->SUPER::new()? I suggest replacing your "empty" new methods with comments indicating that new is inherited.
Why are all of your instance variables prefixed with underscore? They are instance variables — of course they are internal — so an underscore prefix is just extra typing for no reason.
Baseline Perl 5 OO is really simple: an object is a reference that has been blessed with a vtable. A vtable is a package stash, which bless looks up from the package name. A method call is performed by looking for that method in the vtable. If found, it is called. If not found, the @ISA array is checked and any packages listed there are searched recursively for the method, which is called if found, otherwise AUTOLOAD is tried similarly. If none of this produces a code reference, a fatal exception is thrown. While calling a method, whatever was used to start the method search is unshifted onto @_.
All the rest is built on those basic mechanisms. These is nothing magic about my $self = shift; at all.
In reply to Re^3: How to completely destroy class attributes with Test::Most?
by jcb
in thread How to completely destroy class attributes with Test::Most?
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |