Guide to The SOLID Principles In Java

Overview If you don’t have much time, this table captures the core of the SOLID principles: Principle Description Single Responsibility Principle (SRP) Clients should not be forced to depend on interfaces they do not use. This principle promotes the idea of small, focused interfaces instead of large, monolithic interfaces. Clients should only be exposed to … Read more

Introduction To The Law Of Demeter In Java

Introduction To The Law Of Demeter In Java

Introduction The law of Demeter states that objects should only interact with their immediate surroundings. Specifically: That means, the methods of an object should only call methods on other objects that: And it should not call methods on objects that: Here is a simple diagram to illustrate the principle: Friends, Strangers??? OK, some new terminologies … Read more