Reputation: 1414
I have .NET enterprise application for work with two different versions. A SQL Compact version so the program can be run without being on our network, and a SQL Server version which we use in the office and factory. The code is 99.99% the same they only differ between imports and declarations.
Right now I have just been keeping the Compact version up to date and creating a branch using VS then just using a set find and replace commands to create the Sever version. This seems like a very archaic solution but I but the idea of having the manually enter every change in both solutions seems more archaic.
I have a two set of classes(in two folders) that handle all the sql connections and commands. Would it be possible to make two branches that overlap in everything but these two folders?
Upvotes: 0
Views: 70
Reputation: 28386
It seems like Dependency Injection would be a useful pattern for your situation. Is it feasible to refactor the code so that you have an IDatabaseProvider, which you can then dynamically configure the app to use either your SQL Compact or SQL Server implementations?
Upvotes: 1