User Tools

Site Tools


principles:liskov_substitution_principle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
principles:liskov_substitution_principle [2020-10-12 16:23] – old revision restored (2013-04-05 12:10) 159.69.186.191principles:liskov_substitution_principle [2021-09-02 18:26] – old revision restored (2021-05-11 22:03) 65.21.179.175
Line 6: Line 6:
 ===== Context ===== ===== Context =====
 /* fill in contexts here: */ /* fill in contexts here: */
-  * [[contexts:Object-Oriented Design]] +  * [[contexts:Object-Oriented Design]] 
 +  * [[contexts:API Design]]
  
  
Line 25: Line 26:
 ===== Rationale ===== ===== Rationale =====
  
 +Let ''P'' and ''Q'' be types and ''Q'' a subtype of ''P''. If LSP is not adhered to, there is an operation accessible through the interface of ''P'' which behaves differently when called on ''Q''. So code which is written in terms of ''P'' will not expect the behavior and will not work as desired.
 ===== Strategies ===== ===== Strategies =====
  
Line 41: Line 42:
 ===== Origin ===== ===== Origin =====
  
-Barbara Liskov: //[[http://portal.acm.org/citation.cfm?id=62141|Data abstraction and hierarchy]]//+Barbara Liskov: //[[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.12.819|Data abstraction and hierarchy]]//
  
  
 ===== Evidence ===== ===== Evidence =====
 /* Comment out what is not applicable and explain the rest: */ /* Comment out what is not applicable and explain the rest: */
-/* + 
-  * [[wiki:Proposed]] +/*  * [[wiki:Proposed]]*/ 
-  * [[wiki:Examined]] + 
-  * [[wiki:Accepted]] +  * [[wiki:Examined]] LSP describes an effect created by object-oriented type systems. There is no human factor in there, so experiments are not needed. The effect was described and thoroughly examined by Barbara Liskov and Jeanette Wing(([[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.28.2615]])). Their reasoning is presented in section [[#rationale]] in a simplified form. 
-  * [[wiki:Questioned]] +  * [[wiki:Accepted]] LSP is widely known in practice, mainly because it is part of Robert C. Martin's [[collections:SOLID]] principle collection. 
-*/+ 
 +/*  * [[wiki:Questioned]]*/
  
 ===== Relations to Other Principles ===== ===== Relations to Other Principles =====
principles/liskov_substitution_principle.txt · Last modified: 2021-10-18 21:50 by christian