NAME

ArrayBasedStorage - An example of an Array based instance storage

SYNOPSIS

package Foo;

use metaclass (
  ':instance_metaclass'  => 'ArrayBasedStorage::Instance'
);

__PACKAGE__->meta->add_attribute('foo' => (
    reader => 'get_foo',
    writer => 'set_foo'
));    

sub new  {
    my $class = shift;
    $class->meta->new_object(@_);
} 

# now you can just use the class as normal

DESCRIPTION

This is a proof of concept using the Instance sub-protocol which uses ARRAY refs to store the instance data.

This is very similar now to the InsideOutClass example, and in fact, they both share the exact same test suite, with the only difference being the Instance metaclass they use.

AUTHORS

Stevan Little <stevan@iinteractive.com>

Yuval Kogman <nothingmuch@woobling.com>

SEE ALSO

COPYRIGHT AND LICENSE

Copyright 2006, 2007 by Infinity Interactive, Inc.

http://www.iinteractive.com

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