The Wayback Machine - https://web.archive.org/web/20190616000053/https://github.com/iluwatar/java-design-patterns/issues/875
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong UML in observer #875

Open
andreazube opened this issue Apr 24, 2019 · 0 comments

Comments

@andreazube
Copy link

commented Apr 24, 2019

The UML diagram presented in the Observer pattern description is wrong.

The multiplicity between Weather and WeatherType is stated to be 0..1, but that is not the case in the code, since you can't create a Weather object without associating it with a WeatherType (the costructor sets the type to "sunny", timepasses() changes that value, but there is no way to remove the type.

Therefore, the correct cardinality should be just 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.