Getters break encapsulation. Only Data Transfer Objects can use them.
Getters that return objects break the Law of Demeter: they expose the knowledge about the object’s dependencies to its clients and increase system coupling.
Getters break encapsulation. Only Data Transfer Objects can use them.
Getters that return objects break the Law of Demeter: they expose the knowledge about the object’s dependencies to its clients and increase system coupling.