in reply to Still not getting it: hashref OO class variables
All that aside, I think you'll find that it's pretty unusual to use class data in a real OO system. In cases where you've really got some kind of class-wide data I'd rather see that data modeled as an object of its own and give each object that needs it a reference to the object. This is a common pattern for configuration data, for example, which is also a common (poor) use of class data.
Another example: I've created in-memory caches in some of my modules using class data. These days I'd use something like CHI instead and give each object a cache handle, defaulting to a memory caching driver that behaves like a class data hash.
-sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Still not getting it: hashref OO class variables
by bramble (Beadle) on Feb 15, 2008 at 00:52 UTC | |
by chromatic (Archbishop) on Feb 15, 2008 at 00:55 UTC | |
by bramble (Beadle) on Feb 15, 2008 at 01:31 UTC | |
by dsheroh (Monsignor) on Feb 15, 2008 at 16:35 UTC |