Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28323 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80024 invoked by uid 1010); 12 Mar 2007 08:54:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 80009 invoked from network); 12 Mar 2007 08:54:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2007 08:54:07 -0000 Authentication-Results: pb1.pair.com header.from=scott.mcnaught@synergy8.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=scott.mcnaught@synergy8.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain synergy8.com designates 202.174.102.10 as permitted sender) X-PHP-List-Original-Sender: scott.mcnaught@synergy8.com X-Host-Fingerprint: 202.174.102.10 hosting.synergy8.com Received: from [202.174.102.10] ([202.174.102.10:51284] helo=hosting.synergy8.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/27-26638-B2515F54 for ; Mon, 12 Mar 2007 03:54:06 -0500 Received: from dsl-202-173-148-163.qld.westnet.com.au ([202.173.148.163] helo=scottnote) by hosting.synergy8.com with esmtpa (Exim 4.52) id 1HQgI6-0000Us-2l for internals@lists.php.net; Mon, 12 Mar 2007 18:54:02 +1000 Reply-To: To: References: <36961.127.0.0.1.1173580198.squirrel@synergy8.com> Date: Mon, 12 Mar 2007 18:53:52 +1000 Message-ID: <000101c76483$f691c470$0900a8c0@scottnote> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acdjx7piNV29qws9QV6jATWeiA4/WwAvClCw In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hosting.synergy8.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - synergy8.com X-Source: X-Source-Args: X-Source-Dir: Subject: RE: [PHP-DEV] Native Singleton Implementation From: scott.mcnaught@synergy8.com Perhaps I should not call it singleton then. Because I'm not trying to put a flexible design pattern with large degrees of freedom as such into core php. All I am trying to achieve is a nice way for people to implement classes that only ever need one instance. Can I ask why you are very much against this if you are? It seems that most people need to do this at some point. I am starting to feel there's a lot of negativity towards this because it's a different approach. Good point about the uniqueness across one / all php instances. I was only thinking of one unique instance for just the current php instance / request. Definitely something to consider. -----Original Message----- From: Sebastian Bergmann [mailto:sb@sebastian-bergmann.de] Sent: Sunday, 11 March 2007 8:26 PM To: internals@lists.php.net Subject: Re: [PHP-DEV] Native Singleton Implementation scott.mcnaught@synergy8.com wrote: > Yes! Moving the singleton functionality into core php. Its an excellent > OOP feature. Besides the obvious implementation considerations (should the Singleton object be unique in a single PHP instance or across "all" PHP instances, etc.), I am very much against putting reference implementations of design patterns into a programming language. If you want this, you have not understood the intention of design patterns (or the difference (in degrees of freedom) when compared to algorithms). -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php