I am working with VB.Net 2 on a web application.
I currently have a module which simply performs actions on the database required for the Accounts Management section on the website, for example -
GetUsers
GetUser(By Code)
GetUser(By Key)
CreateUser
DeleteUser
UnlockUser
EditUser
Etc...
This is fine but now I need to make a demo version of the website which makes no database updates. It needs to be able to perform all the operations but simply in memory and not write anything to the database.
So I think I will probably need to create a new class/module which does these same operation but just in memory and maybe a another class which choses whether to use the database or memory version. But as I am new to patterns I cannot work out which pattern or composite patterns to use.
Do I need two new classes or put both the logic for which method to use and the memory methods in one class?
Do I need to make an interface which both the memory and DB classes implements?
I currently have a module which simply performs actions on the database required for the Accounts Management section on the website, for example -
GetUsers
GetUser(By Code)
GetUser(By Key)
CreateUser
DeleteUser
UnlockUser
EditUser
Etc...
This is fine but now I need to make a demo version of the website which makes no database updates. It needs to be able to perform all the operations but simply in memory and not write anything to the database.
So I think I will probably need to create a new class/module which does these same operation but just in memory and maybe a another class which choses whether to use the database or memory version. But as I am new to patterns I cannot work out which pattern or composite patterns to use.
Do I need two new classes or put both the logic for which method to use and the memory methods in one class?
Do I need to make an interface which both the memory and DB classes implements?