0
About Liskov Substitution Principle
<<Derived objects should be treated as their bases without affect program correctness.>> But what're the advantages? Some key concept missing?
1 ответ
+ 2
Its for consistency across your program.
If you modify methods in derived class that does a completely different task than its parent class, it will break the system at some point.
Because someone else will try to use the derived class to do what the base class does.
Since the child class should only extend the functionality of base class. Unless you are doing something special.
Keep in mind the open-closed and single responsibility principle.