The StorageProvider has become quite massive. Its main problem is that it has hardcoded paths in there. So it would be nice to separate it into a core path and the functions that are built up on top. Ideally, we can make the paths configurable this way.
The StorageCore should contain the follwing functions:
upload
get_file_content
update_file
move_file
delete_file
All other functions should remain with what we currently call the StorageProvider, which inherits from the StorageCore.
How easily we can then peal out the paths in the next step, but the object on which we have to work is already much smaller. Here the paths might be read from a config file. However, how can this ensure that it is consistent across devices ? I much rather prefer that the path is set as a class variable and any dev can simply set it as he creates a new class.
The StorageProvider has become quite massive. Its main problem is that it has hardcoded paths in there. So it would be nice to separate it into a core path and the functions that are built up on top. Ideally, we can make the paths configurable this way.
The
StorageCore
should contain the follwing functions:upload
get_file_content
update_file
move_file
delete_file
All other functions should remain with what we currently call the
StorageProvider
, which inherits from theStorageCore
.How easily we can then peal out the paths in the next step, but the object on which we have to work is already much smaller. Here the paths might be read from a config file. However, how can this ensure that it is consistent across devices ? I much rather prefer that the path is set as a class variable and any dev can simply set it as he creates a new class.
Opinions @ShukunZhang ?