in reply to Re^4: OO automatic accessor generation
in thread OO automatic accessor generation
Depends on the coders goal.
package DataTable; use Moose; has 'tablename' => (is => 'rw', isa => 'Str'); has 'columns' => (is => 'rw', isa => 'ArrayRef[Str]'); has 'indices' => (is => 'rw', isa => 'HashRef[Str]'); has 'datatypes' => (is => 'rw', isa => 'ArrayRef[Str]'); has 'lengths' => (is => 'rw', isa => 'ArrayRef[Int]'); has 'decimals' => (is => 'rw', isa => 'ArrayRef[Int]'); has 'signed' => (is => 'rw', isa => 'ArrayRef[Int]'); has 'allownull' => (is => 'rw', isa => 'ArrayRef[Int]'); has 'default' => (is => 'rw', isa => 'ArrayRef[Int]'); has 'usequote' => (is => 'rw', isa => 'ArrayRef[Int]'); 1;
Thats a lot of simplification right there. And I wouldn't be surprised to find that there might be a short cut to creating a bunch of attributes with the same definition.
___________
Eric Hodges
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: OO automatic accessor generation
by eric256 (Parson) on Nov 11, 2009 at 21:17 UTC | |
Re^6: OO automatic accessor generation
by WizardOfUz (Friar) on Nov 12, 2009 at 10:38 UTC | |
by eric256 (Parson) on Nov 12, 2009 at 15:12 UTC | |
by WizardOfUz (Friar) on Nov 12, 2009 at 17:08 UTC | |
by stvn (Monsignor) on Nov 12, 2009 at 20:42 UTC | |
by eric256 (Parson) on Nov 12, 2009 at 20:31 UTC | |
by WizardOfUz (Friar) on Nov 13, 2009 at 15:04 UTC | |
|
In Section
Meditations