in reply to Class::Accessor and Damian's PBP
If you have so many accessible properties that you need to generate accessors for them, you may need to re-think your design. Accessors are a code smell.
Caution: Contents may have been coded under pressure.
But assuming you have good reason to have so many accessors, I'm sorry to say I don't have a satisfactory answer to your question. I would go with Class::Accessor::Lvalue because I think that something that behaves like a variable (being settable and gettable) should have an interface like a variable. It is also very clear about when you're setting and when you're getting. If you then use Class::Accessor for the read-only accessors, everything is taken care of.
Caution: Contents may have been coded under pressure.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Class::Accessor and Damian's PBP
by grantm (Parson) on Feb 23, 2006 at 00:49 UTC | |
by acid06 (Friar) on Feb 23, 2006 at 15:15 UTC | |
by Roy Johnson (Monsignor) on Feb 23, 2006 at 17:57 UTC | |
Re^2: Class::Accessor and Damian's PBP
by nothingmuch (Priest) on Feb 22, 2006 at 20:59 UTC | |
by TheDamian (Priest) on Feb 25, 2006 at 20:09 UTC | |
by nothingmuch (Priest) on Feb 26, 2006 at 06:52 UTC | |
by Roy Johnson (Monsignor) on Feb 22, 2006 at 21:04 UTC | |
by nothingmuch (Priest) on Feb 22, 2006 at 21:06 UTC | |
by Roy Johnson (Monsignor) on Feb 23, 2006 at 17:40 UTC | |
by nothingmuch (Priest) on Feb 24, 2006 at 00:00 UTC | |
| |
Re^2: Class::Accessor and Damian's PBP
by cbrandtbuffalo (Deacon) on Feb 23, 2006 at 12:47 UTC | |
by Roy Johnson (Monsignor) on Feb 23, 2006 at 19:54 UTC | |
by cbrandtbuffalo (Deacon) on Feb 23, 2006 at 21:24 UTC | |
Re^2: Class::Accessor and Damian's PBP
by diotalevi (Canon) on Feb 22, 2006 at 20:33 UTC | |
by acid06 (Friar) on Feb 23, 2006 at 15:07 UTC |
In Section
Seekers of Perl Wisdom