RE: [PEAR-DEV] general questions

From: Date: Thu, 29 Nov 2001 00:40:58 +0000
Subject: RE: [PEAR-DEV] general questions
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3166@lists.php.net to get a copy of this message
> -----Original Message----- > From: Joao Prado Maia [mailto:jpm@phpbrasil.com] > Sent: Thursday, November 29, 2001 1:34 AM > To: Lukas Smith > Cc: pear-dev@lists.php.net > Subject: RE: [PEAR-DEV] general questions > > > On Thu, 29 Nov 2001, Lukas Smith wrote: > > > > > > > But why do stuff like DB::connect ? > > > > > > Why not put stuff like that in a constructor? > > > > > > > > > > Because DB::connect() can return you a correct object type (ie > > > mysql/pgsql). > > > > > > Well an object can do this also. You just require the proper code in the > > constructor ... Ulf called this a factory in his speech at the php > > conference iirc > > > > DB::connect() is exactly a 'factory' type of function. Am I missing > I guess you are right ... so a factory is not supposed to reside in side the class it is "producing" for? Why? Lukas Smith smith@dybnet.de _______________________________ DybNet Internet Solutions GbR Alt Moabit 89 10559 Berlin Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de info@dybnet.de _______________________________

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