Re: Plug-in strategies?
| From: | Manuel Lemos | Date: | Thu, 31 Oct 2002 05:34:34 +0000 |
| Subject: | Re: Plug-in strategies? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122195@lists.php.net to get a copy of this message | ||
Hello,
On 10/31/2002 02:21 AM, Charles Wiltgen wrote:
Does anyone know of articles that discuss best practices for supporting plug-ins? I searched for a while, but there doesn't seem to be anything out there.Use a base class to implement the common plugin API (generalization). The develop sub-classes that override the functions and variables of that API to provide the different plug-ins. Use a factory function to decide which plugin sub-class to create based on a argument. You may want to take a look at Metabase that is a database abstraction package that supports many databases using this design pattern. http://www.phpclasses.org/metabase You may also want to look into MetaL which is a meta-programming compiler that has many modules that implement different compiler functionality as defined by bindings configuration in XML: http://www.meta-language.net/ -- Regards, Manuel Lemos