There's also another very important rule that I got from "Smalltalk Best Practice Patterns" (by Kent Beck) (I believe), which should be required reading for anyone doing serious OO. Yeah, it's all about Smalltalk, but most of the rules apply to any late-binding OO language like Perl.
The rule is that superclass calls should be made only to the same-named method. In other words, if you're in foo, you should never be calling SUPER::bar. This is the sign of a misunderstanding about SUPER and about objects in general. The point of SUPER is to extend a parent class behavior, not mix it up.
Wanting to "call the code two levels up" or "call a method other than your own name" are both signs of muddled thinking or an extremely bad class design.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re^2: Skipping the middle man & the SUPER gotcha
by merlyn
in thread Skipping the middle man & the SUPER gotcha
by tlm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |