ANNOUNCE: Object::Registrar 0.01 - A global registry for objects 
Author Message
 ANNOUNCE: Object::Registrar 0.01 - A global registry for objects

       Object::Registrar - A global registry of objects that can
       be resolved by names

       use Object::Registrar;

       my $or = new Object::Registrar();

       $nm->bind('Test/Foo', new Foo());      ## or use register()
       $nm->bind('Test/Bar', new Bar());

       my $foo = $nm->resolve('Test/Foo');
       $nm->rebind('Test/Bar', $bar);         ## or use reregister()

       my %objhash = $or->list();
       my %objhash = $or->list('Test/*');

       my $bool = $or->exists('Test/Foo');

       $or->unbind('Test/Bar');               ## or use unregister()

       ## ----------------------------------- ##
       ## Typical usage with error handling   ##
       ## ----------------------------------- ##

       use Object::Registrar;
       use Error qw(:try);

       my $or = new Object::Registrar();
       try {
       catch Object::NotFoundException with {
         my ($ex) = shift;
         print "Caught NotFoundException: $ex\n";

       The Object::Registrar implements is a global registry of
       objects.  This module makes use of the Singleton Pattern
       to achieve the desired functionality.

       Using this module an application can register its Object
       instances in the Registrar with a unique name. Later on in
       the application these object instances can be retrieved /
       resolved by providing the unique name.

       The names provided for identifying the Objects can be
       anything that would be acceptable as a valid hash key in

       For a detailed description of the Singleton Pattern, refer
       Design Patterns, Gamma et al, Addison-Wesley, 1995, ISBN


       All rights reserved.

       This library is free software; you can redistribute it
       and/or modify it under the same terms as Perl itself.


Mon, 19 Apr 2004 23:04:50 GMT  
 [ 1 post ] 

 Relevant Pages 

1. ANNOUNCE: Games::Object 0.01

2. ANNOUNCE: Object::Transaction - transsactions on serialized has objects in files

3. Global DBH for objects

4. Communication between objects and global subroutines in Perl

5. Pointers to global objects...

6. Free: Make 3D scan from real object to virtual object

7. Scripting for both object and non-object (fwd)

8. Scripting for both object and non-object

9. Can I put an object in an object?

10. OO perl : object containing ref to other object

11. Passing an object to another object

12. Passing an OLE object to another OLE object


Powered by phpBB® Forum Software