title: Does the code-to-interface principle apply to entity classes?
body: <p>I'm trying to follow code-to-interface on a project.  Should I be creating an interface first then implementing that interface for entity classes?  I'm thinking this might be taking the interface first approach too far and entities should be ignored.  This is what I mean...</p>
  
  <pre><code>public interface Address {
    public String getStreet();
    public void setStreet(String street);
  }
  
  @Entity
  public class AddressImpl implements Address {
    private String street;
  
    public String getStreet(){
      return this.street;
    }
    public void setStreet(String street){
      this.street = street;
    }
  }
  
  @Entity
  public class OfficeImpl /* implements Office */ {
    private Address location;
  
    public Address getLocation(){
      return this.location;
    }
    public void setLocation(Address location){
      this.location = location;
    }
  }
  
  public class Driver {
    public static void main(String[] args) {
      Office work = new OfficeImpl();
      Address workAddress = new AddressImpl();
      workAddress.setStreet("Main St.");
      work.setLocation(workAddress);
    }
  }
  </code></pre>