principles:liskov_substitution_principle
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| principles:liskov_substitution_principle [2021-09-02 10:49] – old revision restored (2021-05-11 22:04) 65.21.179.175 | principles:liskov_substitution_principle [2021-10-18 21:50] (current) – +++ restored +++ christian | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| ===== Context ===== | ===== Context ===== | ||
| /* fill in contexts here: */ | /* fill in contexts here: */ | ||
| - | * [[contexts: | + | * [[contexts: |
| + | * [[contexts: | ||
| Line 16: | Line 17: | ||
| ===== Description ===== | ===== Description ===== | ||
| - | Object-oriented programming languages | + | Object-oriented programming languages |
| - | But the programming language does not enforce that the subtype | + | The programming language does not enforce that the subtype behaves like the supertype. Method '' |
| Line 25: | Line 26: | ||
| ===== Rationale ===== | ===== Rationale ===== | ||
| + | Let '' | ||
| ===== Strategies ===== | ===== Strategies ===== | ||
| * Only strengthen invariants in subclasses; never weaken them | * Only strengthen invariants in subclasses; never weaken them | ||
| - | * Only waken preconditions when overriding methods | + | * Only weaken |
| * Only strengthen postconditions when overriding methods | * Only strengthen postconditions when overriding methods | ||
| * Use Delegation instead of Inheritance | * Use Delegation instead of Inheritance | ||
| Line 46: | Line 47: | ||
| ===== Evidence ===== | ===== Evidence ===== | ||
| /* Comment out what is not applicable and explain the rest: */ | /* Comment out what is not applicable and explain the rest: */ | ||
| - | /* | + | |
| - | * [[wiki: | + | /* * [[wiki: |
| - | * [[wiki: | + | |
| - | * [[wiki: | + | * [[wiki: |
| - | * [[wiki: | + | * [[wiki: |
| - | */ | + | |
| + | /* * [[wiki: | ||
| ===== Relations to Other Principles ===== | ===== Relations to Other Principles ===== | ||
| Line 79: | Line 81: | ||
| ===== Description Status ===== | ===== Description Status ===== | ||
| /* Choose one of the following and comment out the rest: */ | /* Choose one of the following and comment out the rest: */ | ||
| - | [[wiki: | + | /*[[wiki: |
| - | /*[[wiki: | + | [[wiki: |
| / | / | ||
| Line 92: | Line 94: | ||
| * Barbara H. Liskov , Jeanette M. Wing: // | * Barbara H. Liskov , Jeanette M. Wing: // | ||
| * Barbara H. Liskov , Jeanette M. Wing: // | * Barbara H. Liskov , Jeanette M. Wing: // | ||
| + | |||
| + | ===== Discussion ===== | ||
| + | |||
| + | Discuss this wiki article and the principle on the corresponding [[talk: | ||
| + | |||
principles/liskov_substitution_principle.1630572543.txt.gz · Last modified: by 65.21.179.175
