Preventing Liskov Substitution violation
I am reimplementing some component and noticed that the original version has a Liskov Substitution violation. It’s not all that critical, though I’d like to get rid of it in the new implementation . It is however not clear to me how to do this.
Is it good to have an interface plenty of methods which belong to different concepts, just to preserve the Liskov’s Principle?
I’m currently studying a course based on Software Design and I had a discussion in class with my professor and some classmates about a problem represented by the next scenario:
Is there a specific name for the “Square inherits from Rectangle” paradox?
A certain failure of OOP is shown with a class Square inheriting from Rectangle, where logically Square is a specialization of Rectangle and should therefore inherit from it, but everything falls apart when you attempt to change a Square’s length or width.
Is there a specific name for the “Square inherits from Rectangle” paradox?
A certain failure of OOP is shown with a class Square inheriting from Rectangle, where logically Square is a specialization of Rectangle and should therefore inherit from it, but everything falls apart when you attempt to change a Square’s length or width.
Is there a specific name for the “Square inherits from Rectangle” paradox?
A certain failure of OOP is shown with a class Square inheriting from Rectangle, where logically Square is a specialization of Rectangle and should therefore inherit from it, but everything falls apart when you attempt to change a Square’s length or width.
Is there a specific name for the “Square inherits from Rectangle” paradox?
A certain failure of OOP is shown with a class Square inheriting from Rectangle, where logically Square is a specialization of Rectangle and should therefore inherit from it, but everything falls apart when you attempt to change a Square’s length or width.
Is there a specific name for the “Square inherits from Rectangle” paradox?
A certain failure of OOP is shown with a class Square inheriting from Rectangle, where logically Square is a specialization of Rectangle and should therefore inherit from it, but everything falls apart when you attempt to change a Square’s length or width.
Confusion with Factory pattern regarding Liskov’s Substitution Principle, code maintainability and Unit Testing?
I have a confusion regarding Factory Pattern there are basically two ways You can implement that.
Confusion with Factory pattern regarding Liskov’s Substitution Principle, code maintainability and Unit Testing?
I have a confusion regarding Factory Pattern there are basically two ways You can implement that.
Confusion with Factory pattern regarding Liskov’s Substitution Principle, code maintainability and Unit Testing?
I have a confusion regarding Factory Pattern there are basically two ways You can implement that.