Building a cloud storage application with Adapter Design Pattern

The adapter helps in working with multiple independent components with incompatible interfaces

Jakub Kapuscik
The Startup

--

We often have multiple possible solutions for a given task. It is very important to have the same interface to easily switch between implementations. The problem is that we do not always have control over those components. The Adapter helps using components with incompatible interfaces. If you want to plug your computer to a power supply and travel a lot, it is convenient to have a powerpack that supports multiple types of sockets. Your computer should not care which type of socket you are using and you should be able to change it as needed. Adapter Design Pattern work just like the power adapters.

We are creating an application that stores file submitted by a user in a directory. As our application started growing there are more users and more files. Our server is now running out of disk space and we want to start using cloud solutions. Cloud file storage like Azure Blob Storage or AWS S3 seems to be a good fit. In order to use those functionalities, we will use official third-party libraries. It is quite unlikely that they will have the same interface as our currently used component. The thing that we can do to easily work with them is to create a…

--

--