Doc #54390 [Bgs->Csd]: Please remove the Singleton Pattern from the Docs

From: Date: Mon, 11 Jul 2011 15:56:38 +0000
Subject: Doc #54390 [Bgs->Csd]: Please remove the Singleton Pattern from the Docs
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6861@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: salathe@php.net Reported by: gordon at onlinehome dot de Summary: Please remove the Singleton Pattern from the Docs -Status: Bogus +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: salathe Block user comment: N Private report: N New Comment: Gordon improved the description of the Singleton. See http://svn.php.net/viewvc? view=revision&revision=313136 Previous Comments: ------------------------------------------------------------------------ [2011-07-02 04:18:03] frozenfire@php.net 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. ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#6861) next »