Although not common for getter and setter, the use of these methods can also be used in AOP/proxy pattern uses.eg for auditing variable you can use AOP to audit update of any value.Without getter/setter it's not possible except changing the code everywhere.Personaly I have never used AOP for that, but it shows one more advantage of using getter/setter.
↧