Aug 23, 2017 · 1 min read
MenuComponent abstract class will only have those methods which are there is MenuItem. Current MenuComponent abstract class does not follow the ‘Liskov Substitution principle’ which says that Subtype can be replaced with supertype wherever Supertype is being used.
Here we can’t replace MenuComponent with MenuItem since MenuItem does not support add(MenuComponent menuComponent) and remove(MenuComponent menuComponent).
