Let's write our own example. Imagine that in our application we want to get the current temperature in a city. We had explored a range of available APIs for that and decided to use the openweathermap.org resource. It seems like a complicated procedure—a client makes a request to the API, parses it, retrieves necessary data, and converts from Kelvin to Celsius. This increases the complexity of the application. An end user would be happy to call only one method to get the current temperature. So, we can hide all of the intricacies of getting the weather condition behind the facade, providing only one function as the interface for the facade.
Let's build the first component of our complex system. The WeatherProvider
class ...
No credit card required