[Solved] What is the point of encapsulation? [closed]

[ad_1]

  1. In many cases you are right – small programs doesn’t need encapsulation probably.
  2. Some MS infrastructures (C#/WPF I think in several binding scenarios) requires encapsulation (using properties) and will not work without it.
  3. If you do more in get / set than changing the value or returning it – it will make your code nicer and more robust (do checks, or other staff in the setter for example).

No one forces you to use it anyway…

[ad_2]

solved What is the point of encapsulation? [closed]