Re: New PDO-based DBAL/ORM for PEAR2

From: Date: Wed, 21 Nov 2007 08:11:46 +0000
Subject: Re: New PDO-based DBAL/ORM for PEAR2
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-48540@lists.php.net to get a copy of this message
Le 21 nov. 07 à 02:53, Michael J. I. Jackson a écrit :
On Nov 20, 2007, at 1:29 PM, Bertrand Mansion wrote:
Le 20 nov. 07 à 18:51, Michael J. I. Jackson a écrit :
On Nov 20, 2007, at 6:36 AM, Bertrand Mansion wrote:
and remove the singleton method.
Why?
Singleton what ? Doesn't mean anything for me.
Singleton doesn't create a new database instance. Instead, if you are connecting with the same DSN, username, and password, it will return the same database connection that has already been established with that combination. It's nice so that you don't create multiple database connections with the exact same connection parameters.
I use named connections for that and only one method : getConnection($id = '__default__) IMO, no need for a meaningless singleton method. It's appealing at first to use such method names in your code but it just confuse users in the end because they have no idea what a singleton is or what will be returned. -- Bertrand Mansion Mamasam Work : http://www.mamasam.com Blog : http://golgote.freeflux.net

« previous php.pear.dev (#48540) next »