Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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


In reply to Re^3: "Rites of Passage" wheel reinventing by hardburn
in thread "Rites of Passage" wheel reinventing by dws

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 06:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found