ExpDev07 / coronavirus-tracker-api

🦠 A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!
https://coronavirus-tracker-api.herokuapp.com
GNU General Public License v3.0
1.59k stars 323 forks source link

Structural pattern applied #483

Closed seanli66 closed 3 years ago

seanli66 commented 3 years ago

Decorator pattern is applied to LocationService class and its inheritors. The common functions that were implemented in the LocationService inheritor classes were moved and implemented in their parent, LocationService. the get_locations function work as a decorator function and let the LocationService inheritors work as wrapper to the parent LocationService class