issues
search
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
Creational Design Pattern - Singleton
#133
Closed
ankur7york
closed
3 years ago
ankur7york
commented
3 years ago
Reference Issues/PRs
Creational Design Pattern can be applied
What does this implementation do?
Implemented Singleton
If instance of
COVID19
does not already exist, it is created and returned
If instance of
COVID19
already exists,
Exception
is raised
Ensures existence of only one instance
Benefits
Takes responsibility of managing instance away from programmer
Memory saved
Bugs resulting from multiple instances are avoided
Reference Issues/PRs
What does this implementation do?
COVID19
does not already exist, it is created and returnedCOVID19
already exists,Exception
is raisedBenefits