in reply to Re: Re: Reducing Perl OO boilerplate
in thread Reducing Perl OO boilerplate
I would look at the problem differently.
Once you know those things, then you can start working out what attributes each class needs to have in order to fulfill its requirements. Then, and only then, can you figure out where that information needs to come from. You may find out that most of it shouldn't come from the client at all!
Now, to answer the question "How do I pass attribute/value pairs to a constructor?" ... your very short constructor is actually the canonical (if non-resilient) way of doing it. *shrugs* Personally, I'd never use that outside of golf, but that's just me. There's CPAN code you use every day that uses that (or similarly terse) constructs. Heck, CGI doesn't even use strict!
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Reducing Perl OO boilerplate
by flyingmoose (Priest) on Feb 18, 2004 at 15:12 UTC | |
by dragonchild (Archbishop) on Feb 18, 2004 at 19:13 UTC | |
by flyingmoose (Priest) on Feb 18, 2004 at 20:25 UTC |