Builder pattern and Immutable Objects
Posted onImmutable Objects An immutable object is a read-only object (you cannot change it’s properties). It’s easy to test and automatically thread-safe. Since it’s properties cannot be changed. The object will never have an invalid state. Follow this strategy to make a class immutable: Use a constructor to set ALL properties of the object (it’s immutable, […]