working on it for 2+ months now, Catalyst::Model::DBIC::Schema) is trait
support from config, with search.
It seems other people are interested in this too, so I'd like some help
hashing out the syntax so that we don't end up with different syntaxes
for different modules.
After some discussion with t0m and some more thought I realized that my
approach of just searching @ISA is wrong. Below is the approach I'm
thinking of now (which could be wrong too, but just something to start
For this example we'll use Catalyst::Model::DBIC::Schema as the base
class, and MyApp::Model::DB as the subclass.
The inheritance hierarchy is something like this:
Moose::Object -> C::Component -> C::Model ->
C::M::DBIC::Schema -> MyApp::Model::DB
1) + prefix
traits => ['+Foo']
Will apply the role whose full package name is 'Foo'
2) no prefix
traits => ['Foo']
Will apply 'MyApp::Model::DBIC::Schema::Trait::Foo'
3) ~ prefix
traits => ['~Foo']
Will search for, in this order:
Or something like that, not sure how that would get implemented yet.
Maybe that's too complicated.
Once this is decided, I will probably add it to
MooseX::Traits::Pluggable as '+_trait_ns' => '~Trait', and make a
CatalystX::Component::Traits role on top of that that would give you the
COMPONENT implementation that
does the trait loading from config and calls new_with_traits.