'Design patterns collect data from different databases

actually, i want to collect informations from different sources of data (csv files, databases...), if we don't find the information in one of the sources we will search in an other one, I tried to find a design pattern to solve this problem, Is there some well known design pattern to make us of?



Solution 1:[1]

I think you can use adapter pattern.

Target - defines the domain-specific interface that Client uses.

Client - collaborates with objects conforming to the Target interface.

Adaptee - defines an existing interface that needs adapting.

Adapter - adapts the interface of Adaptec to the Target interface.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gftea