Re: overprotective?

From: Date: Wed, 06 Apr 2005 15:24:06 +0000
Subject: Re: overprotective?
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37116@lists.php.net to get a copy of this message
Lukas Smith wrote:
Philippe Jausions wrote:
AFAIK external calls to objects stored in members is not good design, ss your example demonstrates clearly... Also, if a method is marked
No, this is perfectly valid design in PHP when you are trying to cut down code size used for common task. However you obiously need to drop the "private" or "protected" visibility in favor of "public" (and simply mark it as "package" visibility in a comment).
Sorry, I read you wrong... I focused on the private member while you were refering to the private method...
private, it is to prevent wrappers to access it. Private method should really be used with caution but they are usefull to do the dirty work that could be at risk if an extended class interefered with it.
yes .. and my point is that we are using private in alot of places where we even plan to have code extend. This is the case in tons of packages that implement different drivers/containers.
True, this is probably due to the lack of a scope enforcement in PHP 4 and only @access public or @access private was used... So a review has to be done when converting a PHP4 package into a PHP5-only one. I would think "protected" would actually fit better on most of the cases where a member or method was originally marked "@access private" with PHP 4... -Philippe

« previous php.pear.dev (#37116) next »