Kamaropoulos / COVID19Py

A tiny Python package for easy access to up-to-date Coronavirus (COVID-19, SARS-CoV-2) cases data.
https://pypi.org/project/COVID19Py/
GNU General Public License v3.0
84 stars 57 forks source link

Behavioral Pattern #155

Closed DanRechtman closed 3 years ago

DanRechtman commented 3 years ago

I applied the Observer pattern

I applied the observer pattern to the getLatest method.

How

Applying it is pretty straightforward. All I made an IObserver interface for the observers and a subject interface for the subject.

Then I implemented those interfaces in ConcreteCovidGetLatest for the subject and ConcreteObserver for the observer.

To look for an example of how this work look at test.py