목차
캡슐화를 통한 리펙토링에 대한 내용을 Microsoft에서는
What: Lets you turn a field into a property, and update all usages of that field to use the newly created property.
When: You want to move a field into a property, and update all references to that field.
Why: You want to give other classes access to a field, but don't want those classes to have direct access. By wrapping the field in a property, you could write code to verify the value being assigned, for example.
흔히 말하는 캡슐화의 장점