Currently the net.iakovlev.timeshape.TimeZoneEngine class is initialized using a bunch of overrides of initialize methods. This was fine in the beginning, but now there are already 5 overrides and more is needed (including but not limiting the #58). It's clearly time to introduce a different approach.
My current preference is to use some sort of TimeZoneEngineConfig class for this. This class will have all the configuration parameters exposed as getters. To configure an instance of this class, the Builder pattern will be used, since this approach seems to be sort of standard in the industry (see e.g. AWS and Google Cloud Java SDKs, or the Protobuf, it's really popular). The user of Timeshape will create and configure an instance of TimeZoneEngineConfig and pass it to the TimeZoneEngine.initialize method.
This will require another override of initialize method, but it will be the final one. I'll keep all the current initialize methods for backward compatibility.
If you have any suggestions or comments on this, please comment on this issue.
Currently the
net.iakovlev.timeshape.TimeZoneEngine
class is initialized using a bunch of overrides ofinitialize
methods. This was fine in the beginning, but now there are already 5 overrides and more is needed (including but not limiting the #58). It's clearly time to introduce a different approach.My current preference is to use some sort of
TimeZoneEngineConfig
class for this. This class will have all the configuration parameters exposed as getters. To configure an instance of this class, theBuilder
pattern will be used, since this approach seems to be sort of standard in the industry (see e.g. AWS and Google Cloud Java SDKs, or the Protobuf, it's really popular). The user of Timeshape will create and configure an instance ofTimeZoneEngineConfig
and pass it to theTimeZoneEngine.initialize
method.This will require another override of
initialize
method, but it will be the final one. I'll keep all the currentinitialize
methods for backward compatibility.If you have any suggestions or comments on this, please comment on this issue.