Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: Perl 5 OOP solutions

by chromatic (Archbishop)
on Apr 14, 2006 at 22:24 UTC ( [id://543450]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl 5 OOP solutions
in thread Perl 5 OOP solutions

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://543450]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found