Saurabh.v
Saurabh.v
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).

)
Saurabh.v

Written by

Saurabh.v

bits_pilani_alumnus, software _engineer at make_my_trip, functional_programming_enthusiast, experience_seeker, poet and learner