The method get_US_time_series() of the class CovidAPIv2Integrator calls the class
DataTimeSeries of the file get_data.py to fetch the time series. but to get the time series of the country Us, it specifies the method that bool for the US is true. Hence I implemented the observer
pattern over here in a way that every time methods in class DataTimeSeries changes the state of
US to true, it will notify our method get_US_time_series() of the class CovidAPIv2Integrator.
once the method gets this update, it will proceed with retrieve data for the country US.
Proposed Changes
Created interface for the subject i.e. Subject_interface.py
Created interface for the observer i.e. IObserver_interface.py
Updated class DataTimeSeries i.e Subject Class by adding methods like attach, detach, notify. Moreover Updated to the method get_data_time_series() to notify the observer of the state change.
Updated class CovidAPIv2Integrator i.e. Observer Class by first adding the Update method and modifying the method get_US_time_series() to make it compatible with the observer Pattern
The method get_US_time_series() of the class CovidAPIv2Integrator calls the class DataTimeSeries of the file get_data.py to fetch the time series. but to get the time series of the country Us, it specifies the method that bool for the US is true. Hence I implemented the observer pattern over here in a way that every time methods in class DataTimeSeries changes the state of US to true, it will notify our method get_US_time_series() of the class CovidAPIv2Integrator. once the method gets this update, it will proceed with retrieve data for the country US.
Proposed Changes
Checklist