I need to design a Data access layer DAL .Net Enterprise library version 3.5 Data access application block (DAAB) In my application,I've various logical modules like Registration, billing, order management, user management,etc Am using C# business entities to map the module objects to database tables and then return the List collection to the client.
I would like to design my DAL in such a way that if tomorrow we decide to use some other data access framework we should have minimal code change. Given this, how do i design my class structure? I thought I would have a class DbManagerBase which would be a wrapper over existing .net DAAB This class DbManagerBase would implement an interface called IDbManagerBase which would have public methods like ExecuteReader, ExecuteNonQuery, etc.
The client class ie. RegistrationDAL,UserManagermentDAL would have the following code inside each of its methods: IDbManagerBase obj= new DbManagerBase() obj.ExecuteReader(myStoredProcName) . . . is this a good OOPS design?may i know any better approach please?or do i need to use inheritance here? Can i have all the methods in DbManagerBase class and RegistrationDAL,UserManagermentDAL classes as static?I guess,if i've methods as static then the above interface code wont make any sense...right???