title: DDD - what is proper code structure
body: <p>I am working on legacy project trying to improve project structure. My question is how should I organize code structure. I see two options:</p>
  
  <blockquote>
    <p>#1 business-domain / layer</p>
  </blockquote>
  
  <pre><code>app/
  ----accout/
  --------application/
  --------domain/
  --------infrastructure/
  ----client/
  --------application/
  --------domain/
  --------infrastructure/
  ----transfer/
  --------application/
  --------domain/
  --------infrastructure/
  </code></pre>
  
  <blockquote>
    <p>or #2 layer / business-domain</p>
  </blockquote>
  
  <pre><code>app/
  ----application/
  --------account/
  --------client/
  --------transfer/
  ----domain/
  --------account/
  --------client/
  --------transfer/
  ----infrastructure/
  --------account/
  --------client/
  --------transfer/
  </code></pre>
  
  <p>Which approach would fit better for legacy project? Which is preferable from your experience?</p>
  
  <p>From my point of view, #1 will enable system decoupling during further refactoring. On the other hand, #1 seems easier to achieve for legacy project. </p>