Re: OT
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Fri, 20 Apr 2007 20:41:51 -0500
Vince Morgan wrote:
"Steve" <no.one@xxxxxxxxxxx> wrote in message
news:zGbWh.1456$go5.566@xxxxxxxxxxxxxxx
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@xxxxxxxxxxxxx
==================
.
- References:
- Getting and Setting and best practise
- From: Jim
- Re: Getting and Setting and best practise
- From: Moot
- Re: Getting and Setting and best practise
- From: Steve
- Re: Getting and Setting and best practise
- From: Moot
- Re: Getting and Setting and best practise
- From: Steve
- Re: Getting and Setting and best practise
- From: Vince Morgan
- Re: Getting and Setting and best practise
- From: Steve
- Re: Getting and Setting and best practise
- From: Vince Morgan
- Re: Getting and Setting and best practise
- From: Steve
- OT
- From: Vince Morgan
- Re: OT
- From: Steve
- Re: OT
- From: Vince Morgan
- Getting and Setting and best practise
- Prev by Date: Re: OT
- Next by Date: Re: Gzipped content
- Previous by thread: Re: OT
- Next by thread: Re: OT
- Index(es):
Relevant Pages
|