Marcel Grünauer == hanekomu (跳ね込む) > Aspect-0.14 > Aspect::Library::Singleton

Download:
Aspect-0.14.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View Bugs
Report a bug
Module Version: 0.13   Source   Latest Release: Aspect-0.21

NAME ^

Aspect::Library::Singleton - A singleton aspect

SYNOPSIS ^

  use Aspect::Singleton;

  aspect Singleton => 'Foo::new';

  my $f1 = Foo->new;
  my $f2 = Foo->new;

  # now $f1 and $f2 refer to the same object

SUPER ^

Aspect::Modular

DESCRIPTION ^

A reusable aspect that forces singleton behavior on a constructor. The constructor is defined by a pointcut spec: a string. regexp, or code ref.

It is slightly different from Class::Singleton (http://search.cpan.org/~abw/Class-Singleton/Singleton.pm):

Note that this is just a special case of memoizing.

SEE ALSO ^

See the Aspect pods for a guide to the Aspect module.

You can find an example comparing the OO and AOP solutions in the examples/ directory of the distribution.

BUGS AND LIMITATIONS ^

No bugs have been reported.

Please report any bugs or feature requests through the web interface at http://rt.cpan.org.

INSTALLATION ^

See perlmodinstall for information and options on installing Perl modules.

AVAILABILITY ^

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN site near you. Or see <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>.

AUTHORS ^

Marcel Grünauer, <marcel@cpan.org>

Ran Eilam <eilara@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright 2001 by Marcel Grünauer

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