RE: [PEAR-DEV] general questions

From: Date: Thu, 29 Nov 2001 00:08:40 +0000
Subject: RE: [PEAR-DEV] general questions
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3161@lists.php.net to get a copy of this message
> > > > 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 > > The constructor can do this too, but its currently a > > 'feature' and cannot be guaranteed to work in the future. > > Thats why we're using a static function for factoring the > > appropriate class. > > Sorry to confuse everyone. Of course, constructors don't > return a value. What I meant was the '$this' variable inside > the constructor which can be modified. This, as writte > however, is a feature. I know that there are a lot of things going on in terms of OO features with Zend 2/ PHP5 ... but I don't really see where this would affect this in anyway. Again, I assume the currenty developers had reason to do this how they did. I am just trying to understand why. Could you therefore please elaborate Markus? If this is boring the hell out of the list you can just explain this to me in privat. 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 (#3161) next »