Class::Proxy - an object proxy
use Class::Proxy; my $pobj = Class::Proxy->new( victim => $obj ); $pobj->victim_method();
Objects can be served by Class::Proxy. In practice, any method call to the proxy will be forwarded to the original object (victim). The purpose of that is to alter method calls in a generic way. This can be used for
Class::Proxy
faking
restriction
logging
benchmarking
forwarding
versioning
caching
and many more.
Class::Proxy is a Class::Listener (Class::Listener). Two signals are registered to it:
Class::Listener
When a method is called.
When a victim was assigned.
The Class::Proxy constructor returns a Class::Proxy object and not a victim object. That means it isn't very good hiding itsef and this may cause conflicts. But when the victim class was written following oo-recommendations Class::Proxy should work fine.
[Note] In future Class::Proxy will try to obscure himself (via tie?). Currently ref() or isa() call would reveal Class::Proxy. Also caller() would give hints.
None by default.
Murat Ünalan, murat.uenalan@gmx.dee
Class::Listener, Class::NiceApi and Class::Protected
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Ünalan,'. Assuming CP1252
To install Class::Proxy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Proxy
CPAN shell
perl -MCPAN -e shell install Class::Proxy
For more information on module installation, please visit the detailed CPAN module installation guide.