Dependency Inversion Principle (DIP) – S.O.L.I.D. Framework

The fifth and final principle within the S.O.L.I.D. Framework is the Dependency Inversion Principle. The main statement of this principle is “Entities must depend on abstractions not on concretions. It states that the high level module must not depend on the low level module, but they should depend on abstractions”. On the first sight this may sounds useless,…

Interface Segregation Principle (ISP) – S.O.L.I.D. Framework

The fourth principle of the S.O.L.I.D. Framework is the Interface Segregation Principle (ISP) . The main statement of this principle is “clients should not be forced to implement interfaces they don’t use“. This basically means that any software developer should use very short and small interfaces instead of one big ones. In the following example I demonstrate the…

Liskov’s Substitution Principle (LSP) – S.O.L.I.D. Framework

The third principle of the S.O.L.I.D. Framework is the Liskov’s Substitution Principle (LSP). The main statement of this principle is “derived types must be completely substitutable for their base types“. What does that means? Well, basically that every parent class should be replaceable by one of its derived child classes without any problems. Imagine we have…