Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I'm not mistaken, you are asking two questions:</p> <ol> <li>How to structure a DDD application?</li> <li>What about those long namespace names?</li> </ol> <p>My answer is rather lengthy - I took the liberty of splitting it into two anwsers.</p> <p>This is an answer to the second question:</p> <p><strong>2. What about those long namespace names</strong></p> <p>I don't think long namespace names are necessarily messy. IMHO what looks messy in your names are:</p> <ul> <li>the repeating of the words "Product" and "Core"</li> <li>The use of the general term "Impl"</li> </ul> <p>A first improvement could be:</p> <pre><code>// The Domain objects go here; MyCompany.MyProduct.Core.Domain; // DataAccess interfaces go here: MyCompany.MyProduct.Core.DataAccess; // a Linq implementation of the DataAcces interfaces go here: MyCompany.MyProduct.Core.DataAccess.LinqImpl; // The Core service go here: MyCompany.MyProduct.Core.Services; // Some general purpose infrastructure goes here (e.g. emailing code) Mycompany.MyProduct.Infra; </code></pre> <p>Furthermore, I find that the use of a commercial product name (such as MyProduct) in the code structure is bad (what if marketing chooses a different name?); I like to use the name of logical subsystems instead. Let's assume your building car rental system. Then <code>CarRental</code> will be considered the core functionality of this app. Then I'd use the following namespace structure (Serra is the name of my company):</p> <pre><code>// For classes Customer, Account, Car Serra.CarRental.Domain; // I use Dao as a general abbreviation for "Data Access Objects" // Dao interfaces go here: Serra.CarRental.Dao; // Linq implementation for Dao interfaces Serra.CarRental.Dao.Linq; // For Services specific to the car rental domain: // AccountService and RentalService and CarAvailabilityService Serra.CarRental.Services; // For UI objects (not relevant in you situation?) Serra.CarRental.UI; // general service code; ignorant of the CarRental domain (e.g. an EmailService) Serra.Infra.Service; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload