note 52228 added to language.oop5.constants
| From: | esad at 25novembar dot com | Date: | Mon, 25 Apr 2005 08:03:34 +0000 |
| Subject: | note 52228 added to language.oop5.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88516@lists.php.net to get a copy of this message | ||
Refering to caliban at darklock dot com's article:
The whole idea of visibility is implementing the concept of data hiding and encapsulation. This
means exposing as little as possible of the class variables/methods, in order to maintain loose
coupling. If you reference all your variables in your class directly, you've probably missed
the point of OOP.
If the variable visibility is set to private it shouldn't be readable outside the class
(performing tricks to read it is pointless, if you want to read something, make it public, it's
your code). This is not used to obfuscate/hide a variable from someone but to enforce good coding
practice of maintaining the loose coupling between objects.
http://c2.com/cgi/wiki?CouplingAndCohesion
----
Manual Page -- http://www.php.net/manual/en/language.oop5.constants.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52228
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52228&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52228&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52228&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52228&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52228&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52228&report=yes
Search -- http://master.php.net/manage/user-notes.php