|
Posted by Marcus Bointon on 10/21/83 11:17
I'm looking to build a plugin system for my web application. I'm
going to need to handle multiple types of plugin. I know that many of
them exist already, but I'm wanting something that's very object-
clean and PHP5-aware. I was thinking about using multiple interface
implementations, so that I could have a plugin that provides a
particular kind of database access, provides a user interface for
admin purposes, and a simple display unit perhaps for connection
status. In this case I'd define a class like:
class mynewplugin extends pluginbase implements database, admin,
display {
//...
}
I would then be able to introspect (using class_implements etc) to
find, for example, all plugins that implement database access. I
could easily add more plugin types by adding more interface types.
The overall benefit being that all kind of plugin are handled through
a single mechanism.
Does this sound like a solid structure and mechanism?
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk
Navigation:
[Reply to this message]
|