문제

I am sure this is really simple but I generally hit a black spot with persisting data. I want to create a form of 'auto history' for my application. The app has the usual undo/redo feature which is in memory and lives only for a given session. The idea is based on the new auto history feature for VS2013

Each time the user makes a change I want to save a timestamped copy of the object plus some admin data so that it can be recovered later. So far I have considered:

  • Just using a list in memory. But this would not survive sessions so it would need to be loaded at the start and saved at the end. I think it could get large over time and become a memory hog
  • Disk based data structures such as bPlusDotNet or Managed ESENT
  • Some sort of Object database like VelocityDB

But I have a sneaky suspicion that I am making it far too complicated. I am using Protobuf NET to serialize my objects, although I am not sure if that is relevant to the problem. So my question is what is the best way to persist the history objects so that they can be later used in a auto history function?

Thanks in advance

도움이 되었습니까?

해결책

I think this needs closing off. After more research I found NDatabase

Pretty straight forward for a mutt like me and it does what I want in providing persistence for a set of objects that all inherit from the same base class but are different in the detail. I have already found some more applications for it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top