[Dbix-class] how to persuade my colleges to use DBIx::Class

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Tue Mar 4 17:40:14 GMT 2008


Stuart Jansen <sjansen at gurulabs.com> wrote on 03/04/2008 10:15:36 AM:

> On Tue, 2008-03-04 at 12:00 -0300, Jose Fonseca wrote:
> > Isn't SQL dreadful enough to convince them!!!
>
> SQL is actually beautiful. In fact, sometimes I get annoyed that DBIC
> makes some things harder than SQL.
>
> The dreadful thing is not SQL, it is moving stuff in and out of data
> structures. That's why I love DBIC, because it makes my data structures
> smarter, allowing me to focus on the interesting problems.
>
> I would focus on the advantage of DBIC as a central point to enforce
> rules that can't be easily enforced by SQL. For example, I've recently
> become annoyed with the way my app handles whitespace for certain
> fields. Instead of scouring the entire app adding normalization rules, I
> can just add a DBIC component and the entire app is fixed painlessly.
>

Selling points for me:

OO perl (if you want it with dbi you roll your own or use something like
dbic and avoid the evil that comes from trying to roll your own)
The power of SQL is still available for you to pass through dbic.
SQL creep seems to be much easier to stop in place vs dbi (where you find
SQL statements pushed all over your codebase).
Schema changes are much easier to manage than editing raw SQL all over the
place.
Transparent (most of the time) Cross DB support, code once use many db
backends.


Points to also understand:

You really do need to understand SQL to use an ORM for anything but simple
cases.
They are not magic database backends that store and freeze data -- all
guidance for DB/SQL (normalization etc) still needs to be applied.
Sometimes you do end up dealing with ORM issues instead of SQL issues.



-Wade




More information about the DBIx-Class mailing list