I am a new CS student working on a project to improve the bus arrival prediction system of my university. Here is a rough diagram of what the system would look like.
I have highlighted in yellow the four sources of data that we need to make our predictions. Note that the Bus Location Listener would maintain a TCP connection with the Bus Location Stream, and the other listeners would just asynchronously fetch the data from their respective APIs using a timer.
The issue is that while it has been easy to fetch the data mentioned above, compiling the data in the Data Model is proving to be a real challenge.
I was thinking of maintaining a single instance of the Data Model that would be shared between all the listeners so that they could each independently update their variables. Yet this feels like the wrong design choice given that it implies the creation of a singleton which I've heard is bad, not to mention I have no idea how to implement it in Python.
Any suggestion would be truly appreciated!
Aucun commentaire:
Enregistrer un commentaire