🦠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!
For my structural pattern I decided to use a composite pattern.
How I did it:
I applied a composite pattern to location/csbs.py and location/nyt.py. I created a new file named serialize which has the class serialize, this serializes the location into a dict. Both csbs.py and nyt.py were using the same method, so I created a separate class and imported it in csbs.py and nyt.pt. Composite pattern is used to group objects that are treated the same way as a single instance.
For my structural pattern I decided to use a composite pattern.
How I did it: I applied a composite pattern to location/csbs.py and location/nyt.py. I created a new file named serialize which has the class serialize, this serializes the location into a dict. Both csbs.py and nyt.py were using the same method, so I created a separate class and imported it in csbs.py and nyt.pt. Composite pattern is used to group objects that are treated the same way as a single instance.