in reply to Re: OOPerl isn't that bad after all...
in thread OOPerl isn't that bad after all...
Well, it may be useless in terms of what you originally intended, but they are trying to get some use out of it, or they wouldn't be bothering with subclassing your class. Do you want to let them follow their bliss, or use language features to block them?
Not that I disagree with your comments about the Java fetish for the premature finalisation of interfaces, but I think that the point being made was that sometimes you need to block the users of a class. Occasionally you need to guarantee that one piece of code cannot get at another.
This is harder in Perl5 than it needs to be.
For example, I recently worked on a set of Template modules that could, potentially, have been used by a nasty template author to access elements of the model that the original author obviously didn't intend. Closing this security hole up was a surprising amount of work because of the large variety of ways Perl has of digging into structures. In Java a couple of "private" statements would have made the problem go away.
|
|---|