Re: LSP
Bardur Arantsson <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <[email protected]> |
On 06/18/2015 08:02 PM, Raoul Duke wrote: >> Regarding squares and rectangles--doing it the way you stated violates LSP. >> That there are oodles of OO tutorials that violate LSP with their very first >> example is depressing, though, and in a way is one of the most damning >> indictments of OO. (Or maybe it's just a case of poor naming: real objects >> gain and lose properties willy-nilly, and our names for the various >> groupings violate LSP like crazy. > > > > So LSP I thought was a nice idea, but not something that works out > well in reality due to the context-sensitive subjective weasel words, > "without altering any of the desirable properties of that program" :-) > Uh, see the formal definition with is slightly below on the same Wikipedia page. And yes, it's very hard to *not* violate that rule. Hence "prefer composition over inheritance" and such guidelines. Regards, -- You received this message because you are subscribed to the Google Groups "scala-language" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.