[Dbix-class] Features comparison among ORMS?
Dami Laurent (PJ)
laurent.dami at justice.ge.ch
Sat Nov 23 08:54:45 GMT 2013
> -----Message d'origine-----
> De : Rob Kinyon [mailto:rob.kinyon at gmail.com]
> Envoyé : lundi 11 novembre 2013 15:06
> À : DBIx::Class user and developer list
> Objet : Re: [Dbix-class] Features comparison among ORMS?
>
> What sort of features are you looking for? All the Perl ORMs wrap DBI,
> so connecting to different databases isn't a problem. Among the Perl
> ORMs, only DBIx::Class has resultsets, arguably the most powerful ORM
> concept. (It's not just among Perl ORMs - I don't know of any other
> ORM that has resultsets
Sorry, I'm coming a bit late in this discussion.
For info : DBIx::DataModel (DBIDM) has a notion of "statement object" which is quite similar to the "resultsets" of DBIx::Class (DBIC); see
https://metacpan.org/pod/release/DAMI/DBIx-DataModel-2.41/lib/DBIx/DataModel/Doc/Design.pod#STATEMENT-OBJECTS
The common point between DBIDM statements and DBIC resultsets is the ability to accumulate query information in several steps, in a kind of "lazy way", delaying the actual request to the database to the last moment when all query information is finally known.
DBIC resultsets are probably more flexible : at each step you can add information about columns to retrieve, other tables to join, functions to apply, etc. The reverse of the medal is that it feels a bit like black magic, where the final request to the database can be hard to predict. [Of course this is a purely personal appreciation; I'm quite confident that experimented DBIC users don't feel that way].
DBIDM statements are more like the good old imperative style of programming, with methods for explicitly controlling the lifecycle through states NEW -> REFINED -> SQLIZED -> PREPARED -> EXECUTED.
Regards, Laurent Dami
More information about the DBIx-Class
mailing list