[Catalyst] Catalyst::Model::Adaptor - because models shouldn't
jon at jrock.us
Tue Oct 9 20:16:21 GMT 2007
John Napiorkowski wrote:
> One thing that I've done a lot with these kinds of
> adapters is use AUTOLOAD or use Moose's built in
> attribute delegation to make calling the adapted
> classes methods easier. Would you take a patch for
> something like this and how might you envision it
> working. As a plugin, for example?
If your model is:
use base 'Catalyst::Model::Adaptor';
__PACKAGE__->config( class =3D> 'YourClass' );
my $yourclass =3D $c->model('Foo')
ref $yourclass is YourClass, not MyApp::Model::Foo. Whatever
YourClass->new returns is what $c->model returns.
So, adding anything to Model::Adaptor or a subclass of it would be
pointless, since there's no way you can get at those methods. (You
could get them at COMPONENT time, but not after that.)
Let me know if this is what you were talking about.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 370 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071009/3ad4=
More information about the Catalyst