Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Liskov Substitution (SOLID section) - width/height/length as constructor params #182

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

Merged
merged 2 commits into from
Jan 30, 2017

Conversation

DavidVujic
Copy link
Contributor

The good example of the Liskov Substitution principle in the SOLID section is doing a switch case to set the width/height/length of the shapes. I think they should accept parameters on instantiation. Lot's of code can be deleted: the switch clause and all setters for width/height/length. Less code!

@DavidVujic DavidVujic changed the title refactor: Liskov Substitution - width/height/length as constructor params Liskov Substitution (SOLID section) - width/height/length as constructor params Jan 30, 2017
@ryanmcdermott ryanmcdermott merged commit ac6a51d into ryanmcdermott:master Jan 30, 2017
@ryanmcdermott
Copy link
Owner

Thanks David this has been a long-standing issue and I'm really glad to see it resolved, great work!

@DavidVujic DavidVujic deleted the liskov-substitution branch January 31, 2017 08:12
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

Successfully merging this pull request may close these issues.

2 participants