Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • I forgot to say that Table, Square and SquareTable are third party classes. I have no control on them. My task is to add preconditions and postconditions and not to break LSP. Commented Sep 6, 2013 at 6:27
  • Java takes the view that if T can be cast to U, and (U)someT.member exists, it should be the same as someT.member. I can see that such a rule simplifies the framework design, but at the expense of expressiveness; in a sense, the real problem is interfaces with insufficiently specific names (e.g. if renderableTable had a members getNumberOfColumns and getGraphicalWidth, there would be no conflict) but in many cases things like getWidth are easier to read than getGraphicalWidth. Commented Jan 13, 2014 at 18:02