title: Should Model Objects Have Interfaces?
body: <p>I am creating the domain model in my system.  When designing my model objects, should I make interfaces for each entity object?  People have told me that our web tier should not care about the implementation of an entity and we should be able to swap out implementations, but I'm not sure that would ever happen.</p>
  
  <p>For example, if we have a Teacher class that maintains a List of Students, the getStudents method could either be:</p>
  
  <pre><code>public List&lt;Student&gt; getStudents() {
        return this.students;
  }
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code>public List&lt;Student&gt; getStudents() { 
       return someExternalService.retrieveStudents();
  }
  </code></pre>
  
  <p>I understand this benefit, but what is the general practice?</p>