You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I was looking through your online book, and I wanted to point out that there's a design issue in the section on inheritance. From the text:
However, the two classes cannot be simply replaced with a more general class Person because of the need to distinguish between Man and Woman for the ‘marriage’ association. A solution is to add the Person class as a super class and let Man and Woman inherit from Person.
Given that same-sex marriage is legal in most of the developed world, distinguishing between Man and Woman in the class Marriage makes the implementation fragile to changes in requirements. A more robust solution is to use the type Person.
This is actually a really good example of how untested assumptions that we as software engineers make can come back to haunt us later. This could be a good object lesson on the need for requirements analysis.
The text was updated successfully, but these errors were encountered:
Hi there! I was looking through your online book, and I wanted to point out that there's a design issue in the section on inheritance. From the text:
Given that same-sex marriage is legal in most of the developed world, distinguishing between
Man
andWoman
in the classMarriage
makes the implementation fragile to changes in requirements. A more robust solution is to use the typePerson
.This is actually a really good example of how untested assumptions that we as software engineers make can come back to haunt us later. This could be a good object lesson on the need for requirements analysis.
The text was updated successfully, but these errors were encountered: