in reply to Re: Prevent direct acces to object's attributes
in thread Prevent direct acces to object's attributes
Why do you want to prevent access to object values using $obj->{...}? Maybe you want to educate your project members to not do that?
Reading directly from attributes is not a real problem, but writing is, because there are some interdependencies between attributes: some of them are preprocessed values based on other ones (like a cache), and changing them would produce unexpected behavior on some methods.
Of course, that is mentioned in the POD, but then I thought I missed something from the docs.
I'm new in writing OO code... Now, Moose and InsideOut objects are in my queue for further reading, just after Damian Conway's book!
Thanks to everyone...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Prevent direct acces to object's attributes
by FunkyMonk (Chancellor) on Sep 07, 2009 at 22:12 UTC | |
by JavaFan (Canon) on Sep 08, 2009 at 09:57 UTC |