Hi all,

Consider a big Cake application which could be divided into a small
core and many plugins providing extended funcionality. Pretty much as
Wordpress is built: tiny, efficent core, and pluggable extensions
connected by hooks. The same applies to MediaWiki, to cite just
another wide known example.

I'm getting trouble in figuring out how to accomplish this "plugin
architecture" using our favourite framework. Cake plugins are a cool
way to pack and reuse functionality, but they are not designed to
provide full extensibility with clean interfaces. These are the
limitations I find:

1.- A plugin cannot extend a model defined in the core. It would be
great to have, say, a "Dog belongsTo Person" relationship defined in
the Model and letting the "Dogstar plugin" to add a new Video Model
and a "Dog hasMany Video" relation to the Dog Model. So the results of
Dog->find('all') would vary depending on whether the plugin is
installed or not.

2.- A plugin may extend a Controller too, like for adding a bark()
action to the DogsController. New controllers can be defined in a Cake
plugin, of course, but I haven't found a clean way to extend a
Controller which has already been defined in the core.

3.- Plugins may also alter the views, as it can happen with Wordpress
or MediaWiki plugins, for example. If the "Dogstar plugin" is
installed, a new <div/> element with Videos would be added to every
page, for example.

4.- A plugin may come with a SQL file which would add some new tables
or new columns to existing tables in the application SQL schema.

So those are my thoughts and the limitations I've found while trying
to think about an extensible, modular application with could be
extended by plugins with clean interfaces.

I think this is an interesting topic, as the benefits of such a
powerful plugin architecture go without saying: a small core is easier
to maintain, and packing features in plugins reduce testing costs, for
example.

I'm sure many of you have more experience than me in this area. I'd
like to discuss this approach with you: how would you implement a
plugin system like the one described on a MVC framework?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to