Posted by Jerry Stuckle on 04/21/07 01:41
Vince Morgan wrote:
> "Steve" <no.one@example.com> wrote in message
> news:zGbWh.1456$go5.566@newsfe12.lga...
> You are undoubtedly aware that this has to be the most misunderstood
> behaviour in all of php. Perhaps in all programing in all languages!! The
> number of posts I've read in the last few hours that clearly misunderstand
> _set() and __get() is astonishing! And all I've gleened from them was
> further misunderstanding. Cant blame them realy. You have been trying to
> hammer the point home but the nails have just kept bending. I don't think
> I've ever been so confused about anything in my life.
> Thank you!!
> You have my undying grattitude Steve! :)))
> Vince
>
>
Vince,
It's probably misunderstood because it's pretty much a violation of OO
principles. OO principles indicate you can set and get values - but
that you have separate setter and getter functions for these.
Now you can emulate this in other OO languages such as Java, C++ and
SmallTalk. But it's pretty much frowned upon. Experienced programmers
in these languages pretty much follow the defacto standard to have
separate getter and setter functions of each value you want to be able
to change/retrieve.
Doing it other ways just gets into too much of a hassle.
Now PHP has tried to implement something which really is against OO
principles (so what's new here?).
I've looked at it - but I really don't find it useful. This style is
not implemented in other languages for very good reason - it really
complicates the code, just as these functions do in PHP.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|