On Sun, 07 Nov 2010 11:54:10 -0500, Shlomi Fish <shlo...@iglu.org.il>
wrote:
Class::DBI is old, deprecated, and should not be used or be recommended
to others. One should use DBIx::Class instead:
http://www.dbix-class.org/
Or maybe a different ORM that has a different philosophy from either
DBIx::Class or Class::DBI. There are several other ORMs on CPAN.
I've looked at a few of them, including DBIx::Class.
What blew me away about Ruby on Rails' ORM/DTO stuff, and what I hope to
achieve with DBIx::Nailgun, is that there's little (if any) boilerplate
code required. A *complete* DBIx::Nailgun subclass could be as simple as
...
package MyApp::Widgets;
use base qw( DBIx::Nailgun );
1;
... and that's entirely it.
Sample code that uses that subclass could be as simple as ...
#!/usr/bin/perl
use MyApp::Widgets;
print MyApp::Widgets->find_by_name('Frobnosticator')->{ description } .
"\n";
... or ...
#!/usr/bin/perl
use DBIx::Nailgun;
DBIx::Nailgun->register_prefix('MyApp');
print DBIx::Nailgun->find_widget_by_name('Frobnosticator')->{ description
} . "\n";
... whichever way you prefer.
Every other class I've looked at has needed (or at least strongly
suggested) screenfulls of boilerplate just to end up with what RoR and
DBIx::Nailgun gives you in a few lines.
If I'm wrong, then I'm wrong, but I feel like I'm seeing a gap in the
market for a "zero conf" ORM/DTO thingy.
--
Paul