Re: PHP5 and the DOM model

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

 



On Fri, Apr 18, 2008 at 1:42 PM, Robert Cummings <robert@xxxxxxxxxxxxx>
wrote:

> Nope, the point is moot. If I've made my properties publicly accessible,
> now, due to the ability to trap via __get() or __set(), I can remove
> them and handle them. Thus, I can retrospectively change the semantics
> without care for having exposed the properties themselves. The point is
> moot here because the option now exists to enhance properties at a later
> date without the need to drive the enhancements through a method the
> user must call (the details of __get() and __set() are hidden from the
> user of the properties ;)


i see your rationale now, and yes i agree, using the magic methods does
afford the ability to make transparent changes and thats great.  however,
what im saying is thats still encapsulation, just a different way of
attaining it.  and the other negative of that approach is having to bulk up
the logic in the magic methods.  i tend to use them to handle attempts to
access non-existent params.
actually, tho drifting a bit; i think the __call() magic method is great
because it allows handling of what would otherwise be a fatal error when
trying to invoke a non-existent class method.

-nathan

[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