Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
True, but the OP wasn't about hiding private attributes, but about maintaining public attributes.
Once you've exposed an attribute in the API and and external code is accessing it directly, it becomes complicated to realize "a man in the middle" layer functioning as getter and setters. Classic (a bit contrived) example is an attribute .name which needs at some point to evolve to a getter name() returning a concat of .firstname and .lastname (and probably .middlename) without breaking old code.
Cheers Rolf
In reply to Re^2: Language design: direct attribute access and postponed mutators (Perl Vs Python)
by LanX
|
|