Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Class::Proxy
an object proxy

Class::Proxy - an object proxy


NAME

Class::Proxy - an object proxy


SYNOPSIS


   use Class::Proxy;

        my $pobj = Class::Proxy->new( victim => $obj );

        $pobj->victim_method();


DESCRIPTION

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

  • faking

  • restriction

  • logging

  • benchmarking

  • forwarding

  • versioning

  • caching

and many more.

Altering calls

Class::Proxy is a Class::Listener (the Class::Listener manpage). Two signals are registered to it:

method
When a method is called.

victim
When a victim was assigned.


HIDING

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.

EXPORT

None by default.


AUTHOR

Murat Ünalan, murat.uenalan@gmx.dee


SEE ALSO

the Class::Listener manpage, the Class::NiceApi manpage and the Class::Protected manpage

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy