OO Concept: Liskov Substitution Principle



Hi,

Just read an article talking about the LSP in term of OO design:
http://www.objectmentor.com/resources/articles/lsp.pdf

The article said Rectangle class should not be a superclass of Square
class.

Okay, so how you would design the Rectangle & Square class?


The article did not cover that, so what are your opinion?


Howard
.



Relevant Pages

  • Re: OO Concept: Liskov Substitution Principle
    ... Just read an article talking about the LSP in term of OO design: ... The article said Rectangle class should not be a superclass of Square ...
    (comp.lang.java.programmer)
  • Re: Need suggestions for school patchwork
    ... some sewing (I have already been asked to design Joseph's Dreamcoat for the school production in June - if you want a quiet life, don't let anyone know you sew!) She and another teacher had seen a patchwork banner in another school and wanted to emulate it. ... All of the children have painted designs on a square of white fabric. ... She doesn't want buttons, pop studs, velcro or anything like that, because she doesn't want any visual element interfering with the children's designs. ...
    (rec.crafts.textiles.quilting)
  • Re: business cards
    ... Go back and read what I said about DESIGN. ... every square, that's pretty awful and ametuerish (just like a musician who ... Dogmatism kills jazz. ... Iconoclasm kills rock. ...
    (rec.music.makers.guitar.jazz)
  • Re: New Cybermen unveiled
    ... >> One thing that this design ... > little square front of the chin - i.e. the square whose to edge is the ... > bottom edge of the mouth - is a separate piece, ... > had, where the mouth would open, and a whole line of dialogue would come ...
    (rec.arts.drwho)
  • Re: Early LM prototypes with round front hatch.
    ... design before te design was "frozen". ... square after evaluations of egress. ... through a square hatch than a round one. ...
    (sci.space.history)