![]() ![]() OK, so how did we get a principle out of this? The unsurprising answer is good ‘ole Uncle Bob Martin 1, who describes the principle in a paper he wrote, that references Liskov’s work. In the paper, they state that if we use an object y in place of an object x, but y does not have all the same properties of x, then y is not a subtype of x. Liskov and Jeannette Wing did author a paper that attempts to define subtypes in a way that relates to program correctness. To figure that out, it’s useful to see where this principle was developed and, as it happens, it was not developed or coinedīy Barbara Liskov, for whom the principle is named. To understand this, we need to know what “correctness of the program” means. This principle states that “Objects in a program should be replaceable with instances of their subtypes without altering the correctness of the program”. Which, as it turns out, is not design advice at all. Now, let’s talk about the Liskov Substitution Principle, Principle, and in the second, I recommended ignoring the Open/Closed Principle, since it isĬonfusing and most reasonable interpretations give bad advice. ![]() The first post outlined the problems I see with the Single Responsibility Liskov Substitution Principle is…Not a Design Principle (SOLID is not solid)Īs mentioned in the original post, I’m realizing that the SOLID principles are not as…solidĪs it would seem. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |