Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: The Accessor Heresy

by sauoq (Abbot)
on Nov 28, 2005 at 17:40 UTC ( [id://512298] : note . print w/replies, xml ) Need Help??


in reply to Re^3: The Accessor Heresy
in thread The Accessor Heresy

My point is that getters and setters very often don't come in pairs.

Okay, you have clarified your point successfully. I don't really agree with this either, though. It all depends on what you have to do with your objects. Having two or more inter-related properties, any of which can be set and thereby affect the others, is not particularly rare.

Running with the original example, if you sold custom made hand-woven circular rugs and charged by the square foot, you might be able to imagine situations in which setting either the area or the radius might be important.

-sauoq
"My two cents aren't worth a dime.";