Finding the Stinky Parts of Your Code: Code Smell 256 – Mutable Getters | HackerNoon
Using getters is a significant issue. Exposing internals is a major problem TL;DR: Don’t expose your internals and lose control Problems Mutability Unexpected Changes Ripple Effects Thread unsafety Encapsulation Principle violation Solutions Return shallow copies of your collections Context Immutable...