Re: Re: Scope woe

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

 



Eddie Drapkin wrote:
> On Tue, Jun 30, 2009 at 10:44 AM, Luke<luke@xxxxxxxxxxxxxx> wrote:
> 
> What I meant, and I probably sounded a bit rougher than I absolutely
> had to, was that it's pretty universally lazy and/or bad design to use
> global variables inside a class, because classes have member
> properties.  From a purely philosophical standpoint, classes are
> supposed to be entirely self-contained and any data that a method
> needs to process is supposed to be passed as a parameter, or exist
> inside the class as a property.  It helps to think of classes like
> cars on a highway; if you want it to go faster, you give it some gas
> (pass a method a parameter), but if you want to turn on some music
> while driving, the CDs should already exist in the car (accessing a
> member property) even though they might have been added earlier (via a
> different method with other parameters).  That's probably not the
> greatest metaphor, but I hope you see what I'm saying.
>

You are correct as there was no metaphor in here at all!  This, "It
helps to think of classes like cars on a highway", is almost a simile,
but on the whole I would probably say that you were using an analogy :-)


-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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