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

Creational pattern #481

Closed lilywuyanru closed 3 years ago

lilywuyanru commented 3 years ago

Add creational pattern by creating location factory

The changes are accomplished by creating a LocationFactory class and the get_location factory method. When a user calls the get_location method, we pass in the source string and the return value will be one of the LocationService object based on the source passed in.