Pixie::Proxy - placeholders for real objects in a Pixie store
use Pixie::Proxy; # this only works for blessed Hashes & Arrays currently: my $obj = MyObject->new my $proxy = Pixie::Proxy->px_make_proxy( $obj ); # a while later, after the obj has been stored and $obj goes away... $obj = undef; $proxy->a_method; # same as $obj->a_method, with a lot of magic # auto-magically loads $obj from the store, copies it into # $proxy, and re-blesses $proxy into the right class (MyObject) # before calling a_method() on it.
Pixie::Proxy lets you load objects from a Pixie store on demand. So if you have a tree of objects and you only need to access the root node of the tree, you don't have to face the performance hit of loading the entire tree.
Pixie::Proxy and its subclasses magically fetch the object from the store whenever a method is called, (and if your class uses overload, whenever an overloaded operator is used).
If proxying interferes with your code, or if you simply prefer to load an entire object heirarchy at one go, simply set the
px_is_immediate constant to some true value in the classes you don't want proxied.
Piers Cawley <firstname.lastname@example.org> - code
Steve Purkis <email@example.com> - docs