DDD and the use of Getters and Setters
问题 I've read a few articles/posts regarding the use of Getters and Setters, and how they help to defeat the purpose of encapsulation in domain model objects. I understand the logic behind not using setters - you are allowing client code to manipulate attributes of that object, outside the context of the object business rules and invariants. Now this principal does still confuse me. For example, what happens if I need to change the value of a member variable of an object? For example, if the name