title: design of building DTO from domain object
body: <p>I have a graph of domain objects and i need to build a DTO to send it to the view. How to design it properly? I see 2 options where can I put the DTO building code:</p>
  
  <p>1) Into the DTO constructor. But then the domain object has to present all fields to DTO via getters so it's not a DDD.</p>
  
  <pre><code>public DTO(DomainObject domain) {
     /// access internal fields of different domain object.
  }
  </code></pre>
  
  <p>2) Into the domain object. There will be no problem with accessing fields but the domain object will grow very fast when new view are added.</p>
  
  <pre><code>public DTO1 createDTO1() {
      ...
  }
  
  public DTO2 createDTO1() {
      ...
  }
  
  // and so on...
  </code></pre>
  
  <p>How should I build DTOs properly?</p>