According to Effective Java's Item 15: Minimize Mutability, it is always better to make classes Immutable. According to that, how would I handle classes that are by nature given to change? Some examples would be: A Customer class, where an address or phone number can (and probably will) change.A ShippingRule class, where shippers are selected based on different criteria. It makes sense that the rule should be editable...In such cases, do we necessarily make them immutable? What other conventions are there?
Making a change-prone class immutable
java;object oriented;immutability;domain objects