Re: A question of style - Properties
| From: | Mika Tuupola | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: A question of style - Properties | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-336@lists.php.net to get a copy of this message | ||
On Thu, 26 Apr 2001, clayton collie wrote:
> to be more specific, what style do you prefer :
> a) $an_object->property = $some_value;
> echo $an_object->property;
>
> b) $an_object->setProperty($some_value);
> echo $an_object->getProperty();
Don't remember seeing any answer to this. Is there any
opinion how should PEAR classes handle this?
Personally I would prefer getProperty() and setProperty()
methods over accessing properties directly.
--
Mika Tuupola http://www.appelsiini.net/~tuupola/