Eddie Drapkin wrote:
> On Tue, Jun 30, 2009 at 10:44 AM, Luke<l...@blog-thing.com> 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 :-)


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

Reply via email to