Page 2 of 2
Posted: Wed Nov 09, 2005 6:33 pm
by feyd
If a property must be a certain type, yes, I believe it should have a get/set. If the property is a "public" or "protected" one, I generally believe they should have a get/set. If it should be read only, you should only have only a get available for the outside, while authentication should be used on the set method. On private variables, I don't think they are necessary unless there needs to be some form of processing done whenever it's accessed.. This follows the instances I listed previously..
Posted: Wed Nov 09, 2005 7:34 pm
by Chris Corbyn
feyd wrote:If a property must be a certain type, yes, I believe it should have a get/set. If the property is a "public" or "protected" one, I generally believe they should have a get/set. If it should be read only, you should only have only a get available for the outside, while authentication should be used on the set method. On private variables, I don't think they are necessary unless there needs to be some form of processing done whenever it's accessed.. This follows the instances I listed previously..
.... and if you're running PHP4 it doesn't really make much difference other than the first sentence

Posted: Wed Nov 09, 2005 8:16 pm
by feyd
true, 5 introduced a lot more support for "standard" OOP support found in many languages, but there is still more work to be done.. 5.1 greatly increased the speed at which PHP could parse and render the code, along with objects, but still has some of the flaws of it's major version (which are being worked on..)
Posted: Wed Nov 09, 2005 8:20 pm
by Jenk
private variables, from what I can see, may be of use for extending and inheritence overloading..
No idea how though :p