title: How many levels of abstraction do I need in the data persistence layer?
body: <p>I'm writing an application using DDD techniques. This is my first attempt at a DDD project. It is also my first greenfield project and I am the sole developer. I've fleshed out the domain model and User interface. Now I'm starting on the persistence layer. I start with a unit test, as usual.</p>
  
  <pre><code>[Test]
  public void ShouldAddEmployerToCollection()
  {
      var employerRepository = new EmployerRepository();
      var employer = _mockery.NewMock&lt;Employer&gt;();
  
      employerRepository.Add(employer);
      _mockery.VerifyAllExpectationsHaveBeenMet();
  }
  </code></pre>
  
  <p>As you can see I haven't written any expectations for the Add() function. I got this far and realized I haven't settled on a particular database vendor yet. In fact I'm not even sure it calls for a db engine at all. Flat files or xml may be just as reasonable. So I'm left wondering what my next step should be.</p>
  
  <p>Should I add another layer of abstraction... say a DataStore interface or look for an existing library that's already done the work for me? I'd like to avoid tying the program to a particular database technology if I can.</p>