Is a square a rectangle? Liskov substitution principle in action
Read OriginalThis technical article uses the geometric question 'Is a square a rectangle?' to explain the Liskov Substitution Principle (LSP) in SOLID design. It demonstrates with C# code how a Square class inheriting from Rectangle can violate LSP by altering the behavior of parent class methods, leading to unexpected results and broken assumptions in code.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser