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 on location #478

Closed antheia-z closed 3 years ago

antheia-z commented 3 years ago

The decorator pattern was introduced in the location folder to make it easier to extend the behavior of the location and to modify the functionality of the location.

To implement the decorator pattern, I added the function decoratedSerialize to decorate serializer methods in CSBSLocation, NYTLocation, and TimelinedLocation, as well as new subclasses of location that may be added in the future, to handle the corresponding new properties.