I am working on a java application which is loading data from one database to another database now according to client requirement
Tool has to load data from one database to another now with other technology
Now the source database is Postgres and previously it is Oracle in future it may be sql server , As if now the target database is postgres only.
We are thinking to use AdapterFactory pattern
Condition is like that
We have a class that is used to produce data say DataProducer and we have a class which consume data say DataConsumer Now both these classes have some functionality that are database related such as package are not avaliable in postgres so we are making a seperate workaround for that type of code . and we have some code that can be used for both database . such as truncate table .
What we are planning is to make a interface each for DataProducer and DataConsumer and make a Base abstract class each for DataProducer and DataConsumer and have common mehod in Base class and specific Methods in the implementation class like PGDataConsumer and OracleDataConsumer
FactoryPattern