Skip to content

Latest commit

 

History

History
executable file
·
16 lines (11 loc) · 720 Bytes

bdb4.md

File metadata and controls

executable file
·
16 lines (11 loc) · 720 Bytes

Back to questions

bdb4: Flawed house

Can you find a design flaw in the following two classes?

Explain what the flaw is, and improve the classes to eliminate it.

Hint: This question is related to question 937d: the class House should maintain an invariant that involves the members floorSize and floorArea. There are at least two ways in which this invariant can be invalidated, despite the fact that no member variables are public. Discuss both of them and propose ways for improvement.