in reply to Re: •Re: "Rites of Passage" wheel reinventing
in thread "Rites of Passage" wheel reinventing
why would you consider a class wrapper to autogenerate accessors to always be a bad idea?
They tend to encourage people to spread accessors everywhere throughout their classes and use them as a crutch for a broken design. Autogenerating mutators are even worse, because now you're not just grabbing internal data, but modifying it, too. You might as well be passing around a bare hash reference and tell everyone to do what they want with it.
Accessors (and to a lesser extent, mutators) can be used well, but they shouldn't be everywhere.
In fact, I'm starting to wonder if Class::DBI was actually a step backwards over Ima::DBI, which Class::DBI is based on. The reason is that Class::DBI exposes the entire database layout, while Ima::DBI performs some action based on the database using pre-defined SQL. I haven't come to a firm conclusion, though, and certainly many people have used Class::DBI to great success.
----
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re^3: "Rites of Passage" wheel reinventing
by merlyn (Sage) on Feb 27, 2004 at 15:58 UTC | |
|
Re: Re^3: "Rites of Passage" wheel reinventing
by grantm (Parson) on Feb 27, 2004 at 18:50 UTC | |
by hardburn (Abbot) on Feb 27, 2004 at 19:17 UTC | |
by ambrus (Abbot) on Feb 27, 2004 at 19:39 UTC | |
by hardburn (Abbot) on Feb 27, 2004 at 19:58 UTC | |
by ambrus (Abbot) on Feb 27, 2004 at 20:25 UTC |