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…