Think about Loose Coupling | |
PerlMonks |
Re^4: OOP's setter/getter method - is there a way to avoid them?by mr_mischief (Monsignor) |
on Nov 05, 2015 at 14:45 UTC ( [id://1146991]=note: print w/replies, xml ) | Need Help?? |
Using the bank account example, though, what if I just want to check my balance? What if I just want to check the date of account creation, or verify my account number? No actual mutation is necessary, but it would be handy to access those values. There wouldn't be a need to mutate those directly, but accessing them without making a deposit or withdrawal should be possible. I suppose you could have a method called query_balance that returns the balance and also updates a log of the query.
In Section
Seekers of Perl Wisdom
|
|