Remove the ServiceLocator + ServiceLocatorCreater construct where the classes that the ServiceLocator instantiates need to be told about the existence of the ServiceLocator via a communication bus.
Why
Because it is incredibly cumbersome. Each of the classes mentioned above now requires three methods just for instantiation, and proper instantiation becomes very hard because the dependencies the ServiceLocator provides cannot be set to final attributes (since they can't be accessed in the constructor).
How
My proposal is to remove the ServiceLocatorCreator entirely, make the ServiceLocator itself a singleton-like class and provide this when the ServiceLocator instantiates other classes.
Definition of done
This is done once there is no longer any need for the greenrobot eventbus to distribute the ServiceLocator AND the ServiceLocator is provided via the constructor of relevant classes.
Parent issues: -
Relevant issues: -
Estimated effort: 3
What
Remove the
ServiceLocator
+ServiceLocatorCreater
construct where the classes that theServiceLocator
instantiates need to be told about the existence of theServiceLocator
via a communication bus.Why
Because it is incredibly cumbersome. Each of the classes mentioned above now requires three methods just for instantiation, and proper instantiation becomes very hard because the dependencies the
ServiceLocator
provides cannot be set tofinal
attributes (since they can't be accessed in the constructor).How
My proposal is to remove the
ServiceLocatorCreator
entirely, make theServiceLocator
itself a singleton-like class and providethis
when theServiceLocator
instantiates other classes.Definition of done
This is done once there is no longer any need for the greenrobot eventbus to distribute the ServiceLocator AND the ServiceLocator is provided via the constructor of relevant classes.
Notes
n/a