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

Bridge Structural Design Pattern Applied #145

Closed Shaqatk closed 2 years ago

Shaqatk commented 3 years ago

Bridge Pattern Applied

A Bridge pattern was applied to COVID19 by creating an abstraction interface in Get_covid_data and an implementation interface in Get_covid_data_implementation.

In the Bridge pattern the operations that the client COVID19 needs are defined in Get_covid_data. Then those all operations are declared in Get_covid_data_implementation. Then Get_covid_data abstraction class references the Get_covid_data_implementation implementation class where all the work is done and passed back.

By using this pattern we can introduce new operations in the abstraction class and the implementation class without them impacting each other. It also allows us to separate the high-level logic into the abstraction class and details in the implementation class without exposing any platform details to the client.