Earlier: Local File System New Requirement: Integrate Azure storage system (Make configurable b/w File and Azure)
My Idea: Create an Interface acting as an abstraction for client (Using factory method) Based on config either Azure or File will be used. Client code won't know. Client just ask for StorageObject and call Create/Download/Delete methods.
IMyStorageObjectInterface storageObject = Storage.GetStorage(); //factory methodstorageObject.Create(path); //Create would either upload on cloud or local
IMyStorageObjectInterface storageObject = Storage.GetStorage(); //factory methodstorageObject.Create(path); //Create would either upload on cloud or local
Problem: I see a 3rd party library being used in some existing methods in the application 3rdPartyConvert&UploadMethod(string/stream filepath)
I guess the above method will successfully upload file given right path(local file path). But how to do this with my Abstract methods(MyStorageInterface) for the client?
Should I let the 3rdParty upload method do its work and then upload via my method(for file system, replace/ignore and for cloud upload it)? Maybe Create an overload of the method (Making such change in each of such methods)? <br>