I have two websites that have an almost identical database schema. the only difference is that some tables in one website have 1 or 2 extra fields that the other and vice versa.
I wanted to the same Database Access layer classes to will manipulate both websites.
What can be a good design pattern that can be used to handle that little difference.
for example, I have a method createAccount(Account account) in my DAO class but the implementation will be slightly different between website A and website B.
If the implementation of the objects would also be almost the same, I would suggest to use an Abstract Base Class. Extend the class by inheritance and make sure your functions that are not aware of the extended field require the base class and not the derived class.
So in this example we have two cars which are almost exactly the same, however, one is a business edition so it has cruise controle. All functions that do not interact with the cruisecontrol can also see it as an ordinary car. Only those that should use the cruise control, should now get the derived class.