Liskov Substitution Principle (LSP) states that if an object o1 is a type of S and it can be substituted for object o2 that is a type of T without violating the original behavior(s) of all its users, ...

I asked this once before and my post was deleted for not providing the code that uses the helper class. This time I have created a full test suite which shows the exact problem.
I am of the opinion ...

Suppose I have an interface and a concrete implementation of it that the client code uses. Now using the proxy pattern that implements this interface i could route the requests made to the interface ...

Could someone please explain what does Refused Bequest means?
I tried reading some articles and says its a kind of code smell or in wiki it tells that it is a class that overrides a method of a base ...

I need to respect the LSP while supporting multiple data types (templates can't be used) and I have a dilemma between inheritance and composition.
If I use inheritance, the base class cannot be used ...

first time poster here.
I'm building a standalone application in C# where I can drop a set of .dwg's and select which .lsp files I want to run on that set. I can figure out how to open a dwg, load a ...

I am implementing a finite element code.
Problem description
In finite element methods, we need an integrator and an interpolator. An integrator is an object that performs numerical integration on a ...

I've recently started reading about the Liskov substitution principle (LSP) and I'm struggling to fully comprehend the implications of the restriction that "Preconditions cannot be strengthened in a ...

I am struggling to adhere to Liskov substitution principle when creating my class structure. I want to have a Collection of calendar items stored within a Day class. There need to be several different ...

I have a problem with the LSP in my program. I have a Base Class that is abstract and two different types of products , one is Food , the other is an Electronic device. I need to make a method that ...

After reading this post I think I mostly understand LSP and most of the examples, but I can’t say I’m 100% certain from my experience of many examples of inheritance, as it seems that many examples do ...

Hello I am using Autocad2012 and I am trying to load a simple "XYZ.fas" file in autocad and want to run the command "XYZ" on every drawing load. I have tried adding the XYZ.fas in the Startup Suite ...

I'm very new to the SOLID design principles. One thing I had problem with understanding is the "Square-rectangle" example of a Liskov Substition Principle violation. Why should the Height/Width setter ...

I've read some of article about the practice that making Square an inheritance class of Rectangle class is a bad practice, saying it violate the LSP (Liskov substitution principle). I still don't get ...

When we have an object hierarchy that is purely a inheritance of semantic and not of behaviors,then inevitably we need to write "instanceof" or "if/else" everywhere to do run time type checking.
E.g.
...