[Dbix-class] Question about dynamic class generation (DBIx::Class::Schema::Loader)

Leandro Hermida leandro.hermida at unibas.ch
Tue Feb 7 15:35:43 CET 2006


Hello,

I read in the digest that doing dynamic schema class generation via
DBIx::Class::Schema::Loader should not be used in production environments.
Is this true only because it is so new?  Or that it won't be recommended in
general for the life of the module? (due to the way it works or something) 

I raise this question because I think either automatic class code generation
or dynamic runtime generation is important to an ORM system like
DBIx::Class.  One can have a database with a large number of tables and
relationships and it would be too much work to maintain the
DBIx::Class::Schema manually created class library.  For these types of
projects you need to automatically generate the ORM classes.  An approach I
have seen which comes to mind are the Apache Torque (Java) and Propel (PHP)
projects.  Propel is essentially the PHP port of Torque.  In these ORM
systems one creates a simple build properties file and defines what their
database should look like using an XML schema (or, if the database exists,
they can generate the XML schema from the existing database).  They then run
the builder which automatically generates the entire all the ORM classes and
the SQL DDL to create their database (if necessary).  Is this a stupid
approach?  To me it seems very useful and it would save a developer a ton of
time but I haven't seen any talk about making a Perl port of Torque or at
least utilizing some of the ideas.  Does DBIx::Class want to provide
features along these lines?

Cheers,

Leandro Hermida




More information about the Dbix-class mailing list