Re: Re: Common Setup package (do pear packages create their own seperate DB connections?)
| From: | Wolfram Kriesing | Date: | Tue, 22 Apr 2003 19:00:47 +0000 |
| Subject: | Re: Re: Common Setup package (do pear packages create their own seperate DB connections?) | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15345@lists.php.net to get a copy of this message | ||
Jeroen Houben wrote:
of course :-) http://www.phppatterns.com/index.php/article/articleview/30/1/1/ but i dont really know if the decorator is the best -- Wolfram http://opensource.visionp.de ... authentication system .... http://sf.net/projects/auththe last discussion started by Jeroen makes me come up with this topic again. I would suggest to provide some kind of Common-package in PEAR, which contains some classes like: - ([M]DB-)connection setup (i.e. PEAR_Common_Connection_DB) - set/getOption (i.e. PEAR_Common_Option) Those would be mini-classes which currently a lot of packages implement over and over again. For some packages it would mean overhead but i think the majority would profit from it. Those Common-classes could be combined with the actual package using the Decorator pattern (i think its not the best way, just a first thought, better suggestions are welcome). PEAR_Common_Connection_DB would provide i.e. - connect() - getInstance() - disconnect() PEAR_Common_Option would provide i.e. - setOption() - getOption() - getOptions() I experienced that in Xipe, Tree and Auth (not PEAR::Auth but [1]) i am using the code always again to implement this functionality and this topic is already bothering me for quite a while. Opinions?Sounds interesting. What is the Decorator pattern, any URLs?