You are here: Re: Getting and Setting and best practise « PHP Programming Language « IT news, forums, messages
Re: Getting and Setting and best practise

Posted by Steve on 04/20/07 20:33

"Vince Morgan" <vinhar@REMOVEoptusnet.com.au> wrote in message
news:462920ca$0$5746$afc38c87@news.optusnet.com.au...
|
| "Steve" <no.one@example.com> wrote in message
| news:L18Wh.591$jj6.399@newsfe03.lga...
| Having lurked silently, I'll just surface for a mo and see if I can test
the
| water without taking too many hits ;)
| The way I see this you are suggesting using __set and __get in a fashion
| that, to a C++ programer, looks somewhat similar to operator overloading.
| Ie:
| $Obj->prop = 12;
| $t = $Obj->prop;
| $Obj->prop * 2;
| $t = $Obj->prop * 2;
| etc.
| Personaly I find this appealing as it is more inclined toward the way I
| prefer to use objects in C++ when practical.
| Of course this may be due to my preference toward that which I am most
| familiar, and my lack of experience with php.
| Perhaps it does also have some synactic sugeriness about it, but I do have
a
| sweet coding tooth. The argument that it does break one of the basic
| accepted features of oop by giving the internals public scope does have
some
| merit. However, personaly I've not ever been tempted to access private
| props within an object, nor do I ever remember doing so accidently. And,
if
| I were to provide such a class to another coder and he/she did so, I would
| have to wonder at his/her proficiencey. Having an object actualy water
| tight is to assume almost complete oblivion on the part of the user.
| It would not be something I imagine a very experienced php programer would
| find immediately intuitive, but then that is certainly not myself.
| Of course, I could actualy be completely off the track, it is very late in
| the eve, ooops, no, it's now actualy quite early in the morning here. But
| if I am understanding all of this correctly. I think it has merit
| personaly. I prefer an object that behaves more like an inbuilt, than one
| that doesn't.
| Having said all this, its time for a crash dive.

what's most funny, vince, is that we are arguing complete theory here. php
does NOT support __set/__get in the way the op thinks it does. i wish it
did, then all of this talk may do some good...for me anyway.

cheers.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация