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

Applying bridge pattern #144

Closed azhan619 closed 2 years ago

azhan619 commented 3 years ago

Hello,

I have applied the structural pattern in your COVID19Py Project in the form of a Bridge pattern, I think this makes your code cleaner and easier to understand. Moreover, this will reduce the overall complexity of the code. For instance, the way I applied the bridge pattern here is that I separated the Data Source class so, that the source of the data is independent of the implementation of the methods fetching covid19 data, hence this way we can define a data source in a different class and implement it is independent of the methods. Moreover, I have introduced the abstract class model to your project to again make it more robust and easier to understand the purpose of each method/class in the project.