go ahead... be a heretic | |
PerlMonks |
Re^4: Perl 5 OOP solutionsby chromatic (Archbishop) |
on Apr 14, 2006 at 22:24 UTC ( [id://543450]=note: print w/replies, xml ) | Need Help?? |
The need for strong encapsulation is (IMO) overblown. I'm pretty sure I wrote the article to which the OP refers (What is Perl 6) and what I meant is that unencapsulated access to attributes in a parent class outside of pure accessors dictates the implementation of descendent classes. Try subclassing IO::Handle sometime. I don't particularly care if it's possible for someone clever or committed or crazy to do bad things with the internals of my objects with reflection or XS or ugly hacks. I do care if I have to work around someone else's poor implementation choices because of bad defaults. Stronger encapsulation keeps the details of the implementation of a class behind an interface, where it belongs.
In Section
Seekers of Perl Wisdom
|
|