Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev
Extensible Catalyst Applications: How?!
 

Index | Next | Previous | View Flat


ido50 at yahoo

Jun 2, 2009, 3:45 AM


Views: 1547
Permalink
Extensible Catalyst Applications: How?!

Hi everyone.

For the last week and a half I've been trying to figure out how to make my Catalyst application extensible, to no avail.

SCENARIO:

1. I have written a Catalyst application called MyApp (The name is a trademark belonging to me so don't steal it).

2. I want people (and me too) to be able to create plugins that extend the functionality of MyApp.

3. I want to create a plugin for MyApp, called "MyPlugin". This plugin in itself is a (near-)complete Catalyst application. It has its own controllers, models, views, etc.

4. I want to "mount" this plugin to some path on MyApp, such that all requests for a path beginning with "/myplugin", for example, are to be routed to MyPlugin's controllers.

5. The context is, of course, to be shared between the two. MyPlugin is seamlessly integrated into MyApp, but any MyPlugin logic is not to be added to MyApp. For example, I do not need to change MyApp.pm to add some MyPlugin specific code, like $c->controller eq $c->controller('MyPlugin::ShootMe') for example.

6. MyPlugin is to be, well, pluggable. I can enable and disable it as/when I wish.

WHAT I'M DOING NOW:

1. I develop MyPlugin as an integral part of MyApp, making all it's controllers MyApp-controllers, and update myapp.conf appropriately (adding a realm perhaps and MyPlugin-related configurations).

2. I add MyPlugin logic to MyApp.pm and maybe other files.

3. I shoot myself in the head.

WHY THIS IS BAD:

1. It's not pluggable.

2. I have interfered with MyApp's code (including myapp.conf) - very bad for development. While one (MyPlugin) depends on the other (MyApp), they should be separate entities.

3. I have shot myself in the head, that can't be good.

So, my question is, what am I to do in order to make my app extensible, at least in the way described above? Do I definitely need to create an API for MyApp? (I will anyway, but is that necessary for the scenario above?).

And also, how can I overcome potential problems like MyPlugin requiring the presence of Catalyst plugins not loaded by MyApp.pm?

Any help heavenly appreciated,
Ido Perelmutter.




_______________________________________________
Catalyst-dev mailing list
Catalyst-dev[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Subject User Time
Extensible Catalyst Applications: How?! ido50 at yahoo Jun 2, 2009, 3:45 AM
    Re: Extensible Catalyst Applications: How?! edencardim at gmail Jun 2, 2009, 6:30 AM
    Re: Extensible Catalyst Applications: How?! ido50 at yahoo Jun 2, 2009, 6:52 AM
    Re: Extensible Catalyst Applications: How?! peter at peknet Jun 2, 2009, 10:14 AM
        Re: Extensible Catalyst Applications: How?! nazgul at somewhere Jun 2, 2009, 10:25 AM
            Re: Extensible Catalyst Applications: How?! peter at peknet Jun 2, 2009, 10:51 AM
                Re: Extensible Catalyst Applications: How?! ivan.wills at gmail Jun 2, 2009, 6:37 PM
    Re: Extensible Catalyst Applications: How?! bobtfish at bobtfish Jun 3, 2009, 2:24 AM
        Re: Extensible Catalyst Applications: How?! zzbbyy at gmail Jun 3, 2009, 2:58 AM
    Re: Extensible Catalyst Applications: How?! ido50 at yahoo Jun 3, 2009, 7:57 AM
        Re: Re: Extensible Catalyst Applications: How?! bobtfish at bobtfish Jun 3, 2009, 8:04 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.