You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
I'm not a big fan of having both a getInstance and initalizer method as it defeats the purposes of those methods separately and I feel this is thread unsafe as it can lead to race conditions.
I'm thinking this can be solved in two ways:
We either change the underlying code to add parameters to getInstance and setting those as class members + referencing those solely through INSTANCE class member. An example of this in Mapbox.java
Other idea is to separate the concerns of this class into different components using a design patterns (eg. a factory pattern could serve as a wrapper around the paremeters?). This should remove the requirement of the initialization method.
Some thoughts capturing from a comment on the Telemetry module PR.
Telemetry is currently initialized with:
I'm not a big fan of having both a
getInstance
andinitalizer
method as it defeats the purposes of those methods separately and I feel this is thread unsafe as it can lead to race conditions.I'm thinking this can be solved in two ways:
We either change the underlying code to add parameters to getInstance and setting those as class members + referencing those solely through INSTANCE class member. An example of this in Mapbox.java
Other idea is to separate the concerns of this class into different components using a design patterns (eg. a factory pattern could serve as a wrapper around the paremeters?). This should remove the requirement of the initialization method.
cc @zugaldia
The text was updated successfully, but these errors were encountered: