Re: Re: OOP::problem?

From: Date: Sun, 06 Apr 2003 12:02:08 +0000
Subject: Re: Re: OOP::problem?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-4664@lists.php.net to get a copy of this message
Mika Tuupola wrote:
On Sat, 5 Apr 2003, Alan Knowles wrote:
PHP is more like C# than Java - in theory you should use the overload extension if you want to implement setter/getters to implement future refactoring/ BC API stuff. (actually the plan is for DB_DataObjects to do this one day)
Overload extension is not quite usable at the moment: http://bugs.php.net/bug.php?id=22004 that is a bug on the call overloading, eg unknown methods, rather than getters/setters.
However it's not a totally clean line (sometimes setters/getters do still make sense.)
I think it better to stick in on way only. Whether to always access properties directly or to always provide an accessor method. Personally I prefer the acccessor methods, slower or not. If you sometimes access properties directly and sometimes by accesssor methods the code will get quite confusing for other developers. As ever = each to there own :) - I just dont like having to write documentaiton for 2 methods + 1 variable rather than just 1 variable , unless it's really necessary.. :)
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.pear.general (#4664) next »