Skip to content

Observer pattern code seem to be incorrect with example output #13

@tuancode

Description

@tuancode

Hi,

I bought the design pattern book and practice it. Then, I recognize a small mistake and want to clarify it, also want to support to help book better. From the book, page 60 and 61, we will have output as below:

Current conditions: 82.0F degrees and 70.0% humidity
Avg/Max/Min temperature = 81.0/82.0/80.0
...
Follow source from github, the output should be:

Current conditions: 82.0F degrees and 70.0% humidity
Avg/Max/Min temperature = 82.0/82.0/82.0
...

And

Current conditions: 78.0F degrees and 90.0% humidity
Avg/Max/Min temperature = 80.0/82.0/78.0
Forecast: More of the same
...
Follow source from github, the output should be:

Current conditions: 78.0F degrees and 90.0% humidity
Avg/Max/Min temperature = 78.0/78.0/78.0
Forecast: Watch out for cooler, rainy weather
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions