| Basicos::Base::Singleton - Proporciona un objeto único en toda la aplicación |
Basicos::Base::Singleton - Proporciona un objeto único en toda la aplicación
package MyPackage;
use base qw(Basicos::Base::Singleton);
package main;
my $obj = MyPackage->instance( @args );
...
my $obj2 = MyPackage->instance();
Este módulo añade funcionalidad a the Basicos::Base manpage, del cual hereda, de manera que sea posible recuperar siempre el mismo objeto en toda la aplicación.
La primera llamada al método the Basicos::Base::Singleton::instance manpage crea el objeto, y las siguientes se limitan a retornar el valor inicialmente devuelto por the Basicos::Base::new manpage.
Admite los mismos parámetros que the Basicos::Base::new manpage y crea un objeto nuevo la primera vez que es invocada. El resto retorna la misma referencia.
Todos los aplicables a the Basicos::Base manpage.
Las mismas dependencias que the Basicos::Base manpage.
There are no known bugs in this module.
Please report problems to the author(s).
Patches are welcome.
Víctor Moral <victor@taquiones.net>, Angel Ortega <angel@triptico.com>
Copyright (c) 2005 <Venexma Europa, S.L.>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
| Basicos::Base::Singleton - Proporciona un objeto único en toda la aplicación |