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
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
Share on other sites

Its the intercepting filter pattern I was likely talking about, I'm really not up on the names of patterns much, Ive always refered to it as a filter chain, not sure where that might have come from.

Link to comment
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.