Skip to content

Conversation

@atayyabi
Copy link

The location services associated with csbs, jhu and nyt require only one instance of each to perform the necessary operation. Therefore in order to avoid wasting memory we would create only one instance of each and access it using the singleton pattern. For this end I created a class-level variable __instance__ and a method getInstance in the parent class LocationService to implement the singleton pattern. And then updated data.init.py module to use the getInstance to retrieve and return the relevant LocationService instance.

@atayyabi atayyabi closed this Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant