[Catalyst] catalyst tutorial: MyAppDB/Book.pm
vs. MyApp/Model/Book.pm
Matt S Trout
dbix-class at trout.me.uk
Tue May 15 09:45:20 GMT 2007
On Tue, May 15, 2007 at 01:19:53AM -0700, mla wrote:
> "So how do you get some of the advantages of ORM and keep control over
> SQL? I employ composition and a couple basic design patterns. For
> example, I have a base model factory interface that uses chainable
> “Loader” modules (ie, DBILoader, MemcacheLoader, MogileLoader) to
> retrieve data and return concrete objects."
>
> I actually like SQL and feel no need to turn it into Perl, so I
> wouldn't mind a light-weight approach like this. But OTOH, as
> Dave Rolsky was arguing earlier, you do want to have the
> data validation in the object. So it seems like we do need *some*
> type of light-weight object interface for inserts and updates.
Well, if you're using DBIx::Class you can get the exact SQL you want 99 times
out of 100 - I'd argue that if you don't know exactly what SQL it's going to
generate as you type your perl code then you're not going to be taking full
advantage of it.
-I- quite like SQL, but 'perl -c' can syntax check my DBIC code for me and
it couldn't syntax check manual SQL, plus it's usually less typing :)
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
More information about the Catalyst
mailing list