I'm implementing a database class to open connection, read, write, delete, update, etc. I'm currently using MySql server.
I'm attempting to write a database class that will be able to cater for different database in future. Maybe we will switch to SQL Server in future. because of this, I hope to design my class in such a way that I can write new classes for SQL Server and it wouldn't affect the client/controller that is calling the database class. I would like to stick to the design pattern principle, open for extension, closed for modification.
In strategy, I could create a abstract class, and create multiple concrete classes for MySql or SQL Server? Does anyone know which pattern should I follow that doesn't violate the rules for these patterns? I am not too sure about adapter. I read that adapter is used to interface existing classes. But in my case, I will be creating my new db classes for SQL Server. Unless I'm using an opensource class.