Peter Karman wrote:
> 
> 
> Oleg Pronin scribbled on 5/2/07 5:30 AM:
>> Greetings!
>>
>> I want to make MyApp::B a part of MyApp::A under namespace for example
>> /folder/
>>
>> Both B and A are normal catalyst applications. (both do
>> '__PACKAGE__->setup()' and etc. and therefore cannot work together).
>>
>> How to do this with minimal changes to application A (for example,
>> using B
>> as plugin) and any complex changes to application B ?
>>
>> I do not want to do this using apache features (setting MyApp::B's
>> handler
>> to location /folder/).
>> I want this: if MyApp::A loads MyApp::B as plugin then all of
>> functionalities of B goes under A/folder/.
>>
> 
> this sounds like a straightforward subclassing arrangement -- unless I'm
> missing something crucial?
> 
> MyBaseClass.pm:
> 
>  package MyBaseClass;
> 
>  # all the stuff currently in MyApp::B here
> 
>  1;
> 
> MyApp/A.pm:
> 
>  package MyApp::A;
>  use base qw( MyBaseClass );
>  1;
> 
> MyApp/B.pm:
> 
>  package MyApp::B;
>  use base qw( MyBaseClass );
>  1;
> 
> 
> then override and extend MyApp::A and MyApp::B for whatever
> application-specific reasons you have.
> 

This sounds good on paper, but in practice it doesn't work. (assuming
::A and ::B containg the Cat stuff like ->setup, Catalyst
qw/Plugins..,/, etc.


You can only call setup once which means you have to put the A stuff in
A, and the B stuff in B, mostly killing the point of subclassing...

Of course, I could be missing the point...

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to