Doc #54390 [Opn->Bgs]: Please remove the Singleton Pattern from the Docs
| From: | frozenfire@php.net | Date: | Sat, 02 Jul 2011 08:18:03 +0000 |
| Subject: | Doc #54390 [Opn->Bgs]: Please remove the Singleton Pattern from the Docs | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6808@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54390&edit=1
ID: 54390
Updated by: frozenfire@php.net
Reported by: gordon at onlinehome dot de
Summary: Please remove the Singleton Pattern from the Docs
-Status: Open
+Status: Bogus
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Singleton patterns are applicable to PHP, in a number of scenarios. The most
common example is to maintain a single database connection for multiple instances
of a database class.
Please do correct me if I'm wrong, but for now, I'm going to mark this bogus.
Previous Comments:
------------------------------------------------------------------------
[2011-03-26 13:18:58] gordon at onlinehome dot de
Description:
------------
The [chapter on Design Patterns in the Manual][1] starts with:
> Patterns are ways to describe best practices and good designs. They show a flexible solution to
> common programming problems.
and then goes on to show a Singleton Pattern. The problems Singletons solve do not exist in PHP. And
even Erich Gamma thinks it's a Code Smell nowadays in general. Consequently, I think we should
not educate people about this pattern and suggest removal.
[1]: http://www.php.net/manual/en/language.oop5.patterns.php
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54390&edit=1