Re: OOP: class variables question
| From: | Teodor Cimpoesu | Date: | Sun, 12 Nov 2000 11:39:50 +0000 |
| Subject: | Re: OOP: class variables question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24855@lists.php.net to get a copy of this message | ||
Hi Chris!
On Sat, 11 Nov 2000, Chris Carbaugh wrote:
> > so until this is implemented (or something else) you can write it by
> > hand :)
>
> If I'm understanding this right,
>
> when the classes are interpreted, all variable are simply prefixed with
> the classes name?
yep
> While this seems like a solution to me (when it gets implemented) it
> doesn't help know.
>
> Consider the following,
>
> I take over a project that's been in progress for years. 10s of
> housands of lines of code, hundreds of classes, many developers.
If you are within class methods, it will work as expected. The interpreter
should know how to resolve 'private' vars. The only 'enforcement' is to avoid
direct references to such vars.
If the programmers insists, ans uses $obj->_class__var, you just can't stop
her shooting to the foot :)
> I couldn't even begin to imagine the problems there. On my current
> project, with about 5 thousand lines of code, 20 couple classes, and me
> as the only developer I've already ran into this problem.
>
> Add the Zend encoder in there, and you can't (in theory, anyway) go
> back and look at the class vars. And no bugger to speak of, your out
> of luck. (anybody using the ?nexidion? debugger yet?)
why not? I dunno how exactly the debugger works, but if the introspection
is done via Zend, then it will get back the proper values.
> Now the solution you describe sounds great, and can be implemented with
> just good programming practice (which is where I missed the boat).
this was just a cool think I liked @ python, among other things :)
> I quess what i'm getting at is if there is a standard I (we all) should
> follow when using OOP? Any of the PHP books cover this? (I've never
Knowing and using the object oriented programming paradigms is enough.
For example, I sow recently some code I really liked how it was written,
and you may take a look at it (trade.ez.no)
-- teodor