NAME
Class::Constructor::Factory - Automated constructor generation
SYNOPSIS
use Class::Constructor::Factory; # exports defer and lazy
BEGIN {
@ISA = qw( Class::Constructor::Factory );
}
__PACKAGE__->mk_constructor0({
magical_number => 42,
timestamp => defer { DateTime->new },
});
# the weird name, mk_constructor0, is on purpose while API settles
DESCRIPTION
NOTE: This module is about to be renamed.
I like the simplicity of Class::Accessor and friends. With them, creating accessors is a piece of cake. It does give me a default constructor as well.
The case is that this default constructor is not as convenient as the generated accessors. To be precise, I want to specify default values for attributes easily. This module is a tentative solution to this problem.
---