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

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Wed Feb 15 12:02:55 CET 2006


castaway at desert-island.demon.co.uk wrote:
> IMO (and I may be off base), it should be possible to use Loader, which 
> will have a standard set of predictable results (which should be 
> detailed in the docs), and then only write your own classes for the 
> parts you need to change / expand. Some flag should possibly set whether 
> the user-created classes replace or extend the Loader ones .. ?

FWIW, that's what I do in my home-grown CDBI/Maypole loader. It works 
well for me. I haven't needed to replace any automatically-generated 
classes; I just override individual methods. For example, I define an 
alternate semantics for find_or_create in my base class and override the 
method in those classes where it's appropriate (some classes have 
special change-logging built in that alters how the find part of 
find_or_create needs to work).

It would be nice when I get around to migrating to find that DBIC 
already has the mechanism :)

Cheers, Dave



More information about the Dbix-class mailing list