Make BgeeProperties a real Singleton?
Currently, each thread acquires its own instance of
org.bgee.model.BgeeProperties#getBgeeProperties()). But I think this method should always return the same singleton.
There is one
BgeeProperties per thread, because there also exists a method
BgeeProperties#getBgeeProperties(Properties), allowing to provide custom properties. This allows to modify the properties programmatically, not only from System properties or from the property file. And the idea was that each thread could acquire a
BgeeProperties object based on different properties.
But currently, the method
#getBgeeProperties(Properties) sometimes do not use the provided properties, when
#getBgeeProperties() was previously called from the same thread (or
#getBgeeProperties(Properties) with different values). It makes no sense.
#getBgeeProperties()could return a singleton, with System and file properties read at class loading
#getBgeeProperties(Properties)could always return a new instance, with the provided properties used
- To fill "missing" values in the provided properties, should we re-read System and file properties? Or use the ones read at class loading? => Maybe we should re-read, as the provided properties could potentially set a new property file to be read.
- In that case, we don't even need this method, the constructor is enough.