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

Location data structural pattern #130

Closed gvmiller closed 3 years ago

gvmiller commented 3 years ago

Changed the way that the getLocationById function works by writing in an Adapter design pattern. I moved around the functionality of the getLocationById function in order to be able to follow the pattern.

This enables the program to fit into any format that is thought of in the future. If the output from getting location data is wished to be changed, then the adapter pattern allows for this to be possible with minimal changes in the code.

The three new classes fit in a pattern format where one Adapter class can change the style of output from the current form to a wished format in the TargetOutput class.