Skip to content

Liskov substitution principle violation #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dotsquid opened this issue Mar 26, 2021 · 1 comment
Closed

Liskov substitution principle violation #5

dotsquid opened this issue Mar 26, 2021 · 1 comment

Comments

@dotsquid
Copy link

Hi.
First of all thanks for an amazing "refactoring.guru" resource. It's definitely a great contribution to global IT education.
However, I think that this example violates the Liskov substitution principle since the Leaf class does not properly implement Add and Remove methods of the base Component class. As such you had to use IsComposite method and call it in the client code.

@dotsquid
Copy link
Author

Here is my humble attempt to fix it #6

@neochief neochief closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants