Currently, if we were to add another object store to the ObjectStore interface we would have to change code in the StoreManager class. This isn't ideal, but it is okay for now while we only have one implementation of the abstract ObjectStore. In the future, we might want to rewrite the StoreManager __init__ to include something like the below:
import importlib
module = importlib.import_module(module_name)
class_ = getattr(module, class_name)
instance = class_()
Where the module_name and class_name are passed via configuration. This would allow us to add new implementations more easily.
Currently, if we were to add another object store to the ObjectStore interface we would have to change code in the StoreManager class. This isn't ideal, but it is okay for now while we only have one implementation of the abstract ObjectStore. In the future, we might want to rewrite the StoreManager
__init__to include something like the below:Where the
module_nameandclass_nameare passed via configuration. This would allow us to add new implementations more easily.