Anonymous
6/23/2025, 2:56:47 PM
No.105680173
>>105679840
>You're still abiding to the contracts the developer of that class choosed. one day he might change the internals of getter/setter and you wouldn't notice anything because the access to that element is encapsulated.
with this train of thought, you are inferring implementation details of the interface
ideally, you would think only about the interface - if there is a getter then it's just another method that returns the value of some property or calculation. you shouldn't care or even think if it's ever been mapped to a field or not. similarly with setters: you just set the value of some abstract property of the interface
>You're still abiding to the contracts the developer of that class choosed. one day he might change the internals of getter/setter and you wouldn't notice anything because the access to that element is encapsulated.
with this train of thought, you are inferring implementation details of the interface
ideally, you would think only about the interface - if there is a getter then it's just another method that returns the value of some property or calculation. you shouldn't care or even think if it's ever been mapped to a field or not. similarly with setters: you just set the value of some abstract property of the interface