Think about Loose Coupling | |
PerlMonks |
Re: Switch from DBI to DBIx::Class: thoughts?by Your Mother (Archbishop) |
on Mar 17, 2009 at 06:08 UTC ( [id://751100]=note: print w/replies, xml ) | Need Help?? |
My feedback about whether you should: Hells yeah! On a more sober note: If your DB layout is clean then you definitely should. If your data is messy and the sort of stuff that makes DB admins cringe then maybe not. Over the years the *only* things I have seen go on the mailing list with no good answers were because the underlying data design was fscked and something designed for clean, correct data design like DBIC just isn't set up to meet it in the middle. There is much more to be gained that simple object abstraction of a row. There's inflation, deflation, serialization, automatic adjunct/auxiliary data generation, validation, schema versioning, x-platform deployment, automatic fixtures, testing, resultset chaining, and more. To do legacy stuff: I'd auto-generate a DBIC schema (Result:: and ResultSet:: namespaces, which isn't in all the docs because it's pretty new but it rules). Then just give new code a shot via the new DBIC schema. Setting it up is trivial; here's a semi-tested snippet-
Then go with it for the next little something-something and see if it's fun or a drag. :)
In Section
Seekers of Perl Wisdom
|
|