Re: Attributes vs. Accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> Curious. Which do you prefer and why?

Accessor methods. They allow for changes in the future that may well
be unforeseen at the moment. Or at least that would be my response
with PHP4. Now with the __get and __set built-in accessors, that's
pretty much taken care of.

> I access directly to avoid pointless method calls for reads.  It'd be
> nice if there were a way to define a public read-only mode,

Not tried this, but you may be able to do it with a __get method that
doesn't return anything.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux