John Napiorkowski wrote:
> --- Jonathan Rockway <[EMAIL PROTECTED]> wrote:
> 
>> 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:
>>
>>    package MyApp::Model::Foo;
>>    use base 'Catalyst::Model::Adaptor';
>>    __PACKAGE__->config( class => 'YourClass' );
>>
>> Then, in
>>
>>   my $yourclass = $c->model('Foo')
>>
>> ref $yourclass is YourClass, not MyApp::Model::Foo. 
>> Whatever
>> YourClass->new returns is what $c->model returns.

Well, there is a downside to that. If I needed to override
YourClass->method to do something specific when it's running in Catalyst
as a model, then I have to create yet a third subclass:

  MyApp::Model::Foo  isa   CatalystYourClass  isa YourClass

instead of just overriding MyApp::Model::FOO->method

Personally, I prefer the latter and AUTOLOAD. If you hate autoload, you
can always map the methods dynamically.

-=Chris

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to