Class-Maker
view release on metacpan or search on metacpan
0.5.15
* package Class::Maker::Basic::Handler::Attributes
-- now handlers are using "Delegation" to methods
- get()
- set()
- init() called from 'new' (or 'default' field) constructor
- reset()
This now eases the interception via hooks and also makes things more transparent.
Example exploit of that:
use Hook::Heckle;
foreach my $method ( qw(max text) )
{
Hook::Heckle->new( victim => $method, post => sub { my $this = shift; print "Model is informing observers of '$method' change\n" and $_[0]->notify_observers( 'update', $method ) if $_[1]; @_ }, sub { @_ } );
}
lib/Class/Maker.pm view on Meta::CPAN
my $p = Person->new( name => Murat, age => 27 );
$p->hello;
=head1 DESCRIPTION
This package is for everybody who wants to program oo-perl and does not really feel comfortable with the common way. Class::Maker introduces the concept of classes via a "class" function. It automatically creates packages, ISA, new and attribute-hand...
Reflection is transparently implemented and allows one to inspect the class properties and methods during runtime. This is helpfull for implementing persistance and serialization. A Tangram (see cpan) schema generator is included to the package, so ...
=head1 INTRODUCTION
When you want to program oo-perl, mostly you suffer under the flexibility of perl. It is so flexibel, you have to do alot by hand. Here an example (slightly modified) from perltoot perl documentation for demonstration:
package Person;
@ISA = qw(Something);
sub new {
( run in 0.505 second using v1.01-cache-2.11-cpan-0a6323c29d9 )