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.
For example, if we have a Teacher class that maintains a List of Students, the getStudents method could either be:
public List<Student> getStudents() {
return this.students;
}
or this:
public List<Student> getStudents() {
return someExternalService.retrieveStudents();
}
I understand this benefit, but what is the general practice?