in reply to Re^3: Still not getting it: hashref OO class variables
in thread Still not getting it: hashref OO class variables

In your comment, are you implying that a subclass should be able to access class data (since a Boot *is*, after all, a Shoe)?
Maybe not class data, but definitely class behavior -- and tracking the number of shoes in the system is behavior.

Ah, ok. Then here is the crux of the matter: Should the subclass be able to access class behaviour as if that behaviour were a part of the subclass itself (since a Boot *is* a Shoe)? Or should the subclass simply access class behaviour via the superclass?

  • Comment on Re^4: Still not getting it: hashref OO class variables

Replies are listed 'Best First'.
Re^5: Still not getting it: hashref OO class variables
by dsheroh (Monsignor) on Feb 15, 2008 at 16:35 UTC
    In general, a subclass should access superclass behaviour via the superclass. That's kind of the point of inheritance, no? Plus it also saves you from having to remember to update all the subclasses every time the superclass behaviour changes.