That issue is neither here nor there. You had to run 10 million method accesses to get an amount of time that was reasonable to measure. That's not a performance problem. My rule of thumb is that classes are allowed to access properties directly within their own class only. An inheriting class should use accessors.
The real problem that you're stumbling on here is that it's basically not possible to inherit from a class in Perl without understanding the data structures of the class you're inheriting from, at least enough to avoid stepping on them. That is an annoyance, but hasn't kept me from using OO in Perl. I rarely use inheritance, and when I do it is usually between two classes that I know well.
In reply to Re: OOP safety
by perrin
in thread OOP safety
by nothingmuch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |