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 320 forks source link

Creational Design Pattern #475

Closed milandrapic closed 3 years ago

milandrapic commented 3 years ago

Here I've added a singleton pattern on the service objects. I've done this by changing the LocationService implementation classes, so that they can only create one instance of the class, and in the data folder I adjusted so that the getInstance method is called instead of the constructor.