<?xml version="1.0" encoding="windows-1252"?>
<node id="701732" title="Re: Perl ORM comparison (Class::DBI vs. DBIx::Class vs. Rose::DB::Object)" created="2008-08-01 11:53:35" updated="2008-08-01 07:53:35">
<type id="11">
note</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
Well, let's see.&lt;br /&gt;&lt;br /&gt;

"We do our best to maintain full backwards compatibility for published APIs, since DBIx::Class is used in production in many organisations, and even backwards incompatible changes to non-published APIs will be fixed if they're reported and doing so doesn't cost the codebase anything."&lt;br /&gt;&lt;br /&gt;

versus&lt;br /&gt;&lt;br /&gt;

"BUT the author states in the documentation that it may change any time!"&lt;br /&gt;&lt;br /&gt;

No. I don't. Please correct.&lt;br /&gt;&lt;br /&gt;

"No support for in-memory-only objects (just like Class::DBI"&lt;br /&gt;&lt;br /&gt;

Wrong. -&gt;new gives you a memory-only object, which you insert by calling $obj-&gt;insert.&lt;br /&gt;&lt;br /&gt;

We also provide a CDBI-ish create() that is a shortcut for new+insert.&lt;br /&gt;&lt;br /&gt;

"No client-side triggers."&lt;br /&gt;&lt;br /&gt;

That's because Class::Trigger style stuff costs you every time you check it for an object without a trigger. What we do instead is make sure things are factored out enough that methods are trivial to override - for e.g.&lt;br /&gt;&lt;br /&gt;

&lt;pre&gt;
  sub insert {
    my ( $self, @args ) = @_;
    $self-&gt;next::method(@args);
    $self-&gt;cds-&gt;new({})-&gt;fill_from_artist($self)-&gt;insert;
    return $self;
  }
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;

is next to no more typing than setting an after_insert trigger in Class::DBI.&lt;br /&gt;&lt;br /&gt;

"Executing arbitrary SQL is more cumbersome (You have to set up a ResultSource for this. Note that executing arbitrary SQL may be considered by some as bad practise for an ORM.)"&lt;br /&gt;&lt;br /&gt;

Well, except you can pass arbitrary chunks for pretty much anything - the 'select' attr lets you control the select clause, the 'from' attr the from clause, and scalar references in the where clause are treated as literal SQL.&lt;br /&gt;&lt;br /&gt;

And, of course, if you want to just get the $dbh, you can just get the $dbh - or run $schema-&gt;storage-&gt;dbh_do(sub { my $dbh = shift; ... }) at which point you'll get our retry/reconnect logic for free as well.&lt;br /&gt;&lt;br /&gt;

So I think "you have to" is basically wrong, at least.&lt;br /&gt;&lt;br /&gt;

I wonder if you need a new, fresh node (and maybe I could poke jcs, the RDBO author, to correct any similar mistakes in your stuff for his work)&lt;br /&gt;&lt;br /&gt;

-- mst (DBIx::Class project founder)</field>
<field name="root_node">
700283</field>
<field name="parent_node">
700283</field>
<field name="reputation">
19</field>
</data>
</node>
