Codebase list libclass-accessor-perl / debian/0.33-1
debian/0.33-1

Tree @debian/0.33-1 (Download .tar.gz)

NAMES
      Class::Accessor         - automated accessor generation
      Class::Accessor::Fast   - faster automated accessor generation
      Class::Accessor::Faster - even faster, using an array

DESCRIPTION

    This module automagically generates accessors/mutators for your class.

    Most of the time, writing accessors is an exercise in cutting and
    pasting. You usually wind up with a series of almost identical methods,
    one for each piece of data in your object. While some will be unique,
    doing value checks and special storage tricks, most will simply be
    exercises in repetition.

    If you make your module a subclass of Class::Accessor and declare your
    accessor fields with mk_accessors() then you'll find yourself with a set
    of automatically generated accessors, which can even be customized!

    The basic set up is very simple:

        package My::Class;
        use base qw(Class::Accessor);
        My::Class->mk_accessors( qw(foo bar car) );

    Done. My::Class now has simple foo(), bar() and car() accessors defined.

BENCHMARKS

    accessors:
              Rate  Basic   Fast Faster Direct
    Basic   367589/s     --   -51%   -55%   -89%
    Fast    747964/s   103%     --    -9%   -77%
    Faster  819199/s   123%    10%     --   -75%
    Direct 3245887/s   783%   334%   296%     --

    mutators:
              Rate    Acc   Fast Faster Direct
    Acc     265564/s     --   -54%   -63%   -91%
    Fast    573439/s   116%     --   -21%   -80%
    Faster  724710/s   173%    26%     --   -75%
    Direct 2860979/s   977%   399%   295%     --

AUTHORS

    Copyright 2009 Marty Pauley <marty+perl@kasei.com>

    This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself. That means either (a) the GNU
    General Public License or (b) the Artistic License.

ORIGINAL AUTHOR

    Michael G Schwern <schwern@pobox.com>