Liskov

quotes below will be decoded into the English language as it relates to the hash table as time allows


 * https://softwareengineering.stackexchange.com/questions/199331/is-there-a-specific-name-for-the-square-inherits-from-rectangle-paradox/238420#238420 The History Constraint/Rule of the Liskov Substitution Principle says that when a subtype adds new methods, those methods are not allowed to manipulate the state of the object in such a way that it creates a history (i.e. a series of states) that is not allowed in the supertype. E.g. you cannot make a subtype of an immutable mutable, because when only manipulated through methods of the supertype, the state is always the same, whereas when manipulated through the mutator methods of the subtype, the state does change. That's a history that is not allowed by the supertype. – Jörg W Mittag May 26 '13 at 0:27


 * In terms of behaviour a square is not a rectangle

behavior is the metaphor for procedure. To clarify: "In terms of input output mapping of the hash table by functions a square is not a rectangle" which is a category error(not sure)?


 * https://en.wikipedia.org/wiki/Composition_over_inheritance This article may be confusing or unclear to readers. Please help us clarify the article. There might be a discussion about this on the talk page. (October 2015) (Learn how and when to remove this template message)

this is deliberate of course, Alan Kay wishes to reserve jobs for only the smartest programmers.

https://en.wikipedia.org/wiki/Object_composition

https://en.wikipedia.org/wiki/Interface_(computing)#Software_interfaces_in_object-oriented_languages

https://en.wikipedia.org/wiki/Property_(programming)

stackexchange

 * https://stackoverflow.com/questions/56860/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 inheritance. However if in code you made Square derive from Rectangle, then a Square should be usable anywhere you expect a Rectangle. This makes for some strange behavior.


 * Imagine you had SetWidth and SetHeight methods on your Rectangle base class; this seems perfectly logical. However if your Rectangle reference pointed to a Square, then SetWidth and SetHeight doesn't make sense because setting one would change the other to match it. In this case Square fails the Liskov Substitution Test with Rectangle and the abstraction of having Square inherit from Rectangle is a bad one.

Squares and rectangles don't exist inside of computers, this mangled thinking is the result of a category mistake.


 * Moral of the story: model your classes based on behaviours not on properties; model your data based on properties and not on behaviours. If it behaves like a duck, it's certainly a bird. – Sklivvz May 19 '12 at 21:43

In English: model your hash map based on the prodecures. Which is to say that functions are the focus, instead of data (Dave Acton. Logical fallacies warps the subject domain.


 * http://web.archive.org/web/20160521015258/https://lostechies.com/derickbailey/2009/02/11/solid-development-principles-in-motivational-pictures/