I'm in the process of catching up on technical documentation for a project I completed some months ago, and one I'm coming close to finishing. I used repositories to abstract out the data access layer in both and was writing a short summary of the pattern on our wiki at work.
It was whilst writing this summary that I realised I took a slightly different approach the second time.
One used an explicit InsertOnSubmit
method coupled with a Unit of Work and an implicit update with the UoW tracking changes. The other had a Save
method which inserted new entries and updated existing (without a UoW).
Which approach would you typically favour? Consider the usual CRUD scenarios, where should the the responbility for each of them lie?