LSP and self-consistency

Moderatoren: pmueller, SE - Design and Construction

tud_std
Erstie
Erstie
Beiträge: 19
Registriert: 13. Apr 2016 16:29

LSP and self-consistency

Beitrag von tud_std »

Hi,
1) In the bottom of slide 7 of LSP lecture, it is written This model is self-consistent. What self-consistency means in this context please?
2) In the LSP paper of Robert C. Martin, page 6, he wrote : "The LSP makes clear that in OOD the ISA relationship pertains to behavior. Not
intrinsic private behavior, but extrinsic public behavior;". I have some hard time to differentiate between these two. Could you please provide a more detailed explanation?
Regards,

eichberg
Moderator
Moderator
Beiträge: 448
Registriert: 25. Sep 2007 12:12
Kontaktdaten:

Re: LSP and self-consistency

Beitrag von eichberg »

In the bottom of slide 7 of LSP lecture, it is written This model is self-consistent. What self-consistency means in this context please?
When you do not consider possible clients (in particular those that just use the base type) and just take a look at the given two classes in isolation everything looks pretty good.
In the LSP paper of Robert C. Martin, page 6, he wrote : "The LSP makes clear that in OOD the ISA relationship pertains to behavior. Not
intrinsic private behavior, but extrinsic public behavior;". I have some hard time to differentiate between these two. Could you please provide a more detailed explanation?
Well - behavior of a class C that is really internal; i.e., which cannot be observed by classes extending C can always be changed; all behavior that somehow can be observed by classes extending C is immediately part of the public API. E.g., a method that that internally uses a collection of type A (which is not passed to another method/which does not escape the method) can always be changed to collection of type B.

tud_std
Erstie
Erstie
Beiträge: 19
Registriert: 13. Apr 2016 16:29

Re: LSP and self-consistency

Beitrag von tud_std »

Many thanks for the feed-back.

Antworten

Zurück zu „Software Engineering - Design and Construction“