Jump to content

Plug-in systems


Recommended Posts

Hello, I'm just wondering how to make an efficient plug-in system. So far, I've thought of including the class, and putting all the plug-in functions into the constructors and destructors, however I was wondering if there is a better way of doing it.

 

Has anyone got any experience in creating plug-ins?

 

Thanks in advance,

 

Tom.

Link to comment
https://forums.phpfreaks.com/topic/104878-plug-in-systems/
Share on other sites

AFAIK there is no 'official' pattern called 'Filter Chain'. There's Java's Filter.Chain, but that's an implementation of Intercepting Filter. There's Chain of Responsibilty, which can be used for chaining filters. The Composite pattern can be used to assemble highly specialized filters. Decorator can be used to create filter chains as well. Last, but not least, the Plugin pattern could be used for this purpose.

 

The latter probably being what the TS is after: linking (any purpose) classes during configuration time, rather than compilation time.

 

Check out this thread for an example of Plugin: http://www.phpfreaks.com/forums/index.php/topic,189363.msg851770.html#msg851770

Link to comment
https://forums.phpfreaks.com/topic/104878-plug-in-systems/#findComment-537391
Share on other sites

Intercepting Filter is mostly useful for manipulating your request and response objects. For example, you might have a filter which checks some ACL rules and changes the dispatch target to an 'unauthorized' page when appropriate. Combinations with the Plugin pattern are common, if not implied by definition.

Link to comment
https://forums.phpfreaks.com/topic/104878-plug-in-systems/#findComment-538160
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.