Can you explain Liskov Substitution Principle with a good C# example? [closed]

(This answer has been rewritten 2013-05-13, read the discussion in the bottom of the comments) LSP is about following the contract of the base class. You can for instance not throw new exceptions in the sub classes as the one using the base class would not expect that. Same goes for if the base class … Read more

What is an example of the Liskov Substitution Principle?

A great example illustrating LSP (given by Uncle Bob in a podcast I heard recently) was how sometimes something that sounds right in natural language doesn’t quite work in code. In mathematics, a Square is a Rectangle. Indeed it is a specialization of a rectangle. The “is a” makes you want to model this with … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)