[Dbix-class] Molesting Schemas

Christopher H. Laco claco at chrislaco.com
Mon Jun 5 18:52:07 CEST 2006


As part of the new Handel stuff, I'm trying to provide as much ability
as possible of using an existing schema instead of just relying on the
default Handel schema.

As part of this process, I'm 'injecting' custom component classes into
the specified schema using load_components. Currently, this operates on
the classes themselves using $schema_class->class($cart_class).

The evil in this is that fact that once I inject Handel components into
the schema classes, they will effect the use of the schema outside of
Handel. This is somewhat of a Bad Thing.

So, my question is two fold: First, is it possible to load_component a
new component into a source instance only, not its class, in a way that
it will only effect the current source/schema instance, and not all
usages of the source class?

$schema_instance->source($cart_source)->load_components(qw/Foo/)

where

$schema_instance->class($cart_class) does not have "Foo" loaded?



If this isn't possible, I think the alternative is for my components to
know when they are and aren't running under Handel code, and have them
simply bypass their code when not running under Handel. IS there a sane
way to do this? Maybe just adding something to the source instances hash?

-=Chris


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20060605/69563107/attachment.pgp 


More information about the Dbix-class mailing list