title: Good naming for domain services layer
body: <h2>Abstract</h2>
  
  <p>Which name is better?</p>
  
  <ul>
  <li><code>Domain.PersonService</code></li>
  <li><code>DomainServices.PersonService</code></li>
  <li><code>DomainServices.PersonDomainService</code> (consider some longer names like <code>PersonDomainServiceModelDecorator</code>)</li>
  </ul>
  
  <p>or something else?</p>
  
  <h2>Situation</h2>
  
  <p>We have a framework in which there are some base classes for each layer. Ex. Repository, Domain Services, UI, etc.</p>
  
  <p>Each logical layer has a name which is used as its namespace:</p>
  
  <ul>
  <li>"Data" for data layer that contains repositories; Ex. <code>Fx.Data.DbContextRepository</code></li>
  <li>"Services" for domain (not web) service layer; Ex. <code>Fx.Services.CrudService</code></li>
  <li>"Web.UI" for Web UI layer; Ex. <code>Fx.Web.UI.Controllers.CrudController</code></li>
  </ul>
  
  <p>We also follow the same rule for end-projects whith some extra layers:</p>
  
  <ul>
  <li>"Data" Ex. <code>Project.Data.PersonRepository</code></li>
  <li>"Services" Ex. <code>Project.Services.PersonService</code></li>
  <li>"Web.UI" Ex. <code>Project.Web.UI.Controllers.PersonController</code></li>
  <li>"Entities" for code-first entities; Ex. <code>Entities.Person</code></li>
  <li>"Models" for object models; Ex. Models.Person.Criteria, <code>Models.Person.PersonDeleteModel</code></li>
  </ul>
  
  <p>My focus is on "Domain Service" layer but any ideas about other layers are also welcomed.</p>
  
  <p>We've finally come to the conclusion that "Services" is not a suitable name for "Domain Services" as it may cause ambiguity between a "Web Service" or "Domain Service" layer.</p>
  
  <p>Now we are changing the "Services" namespace to "Domain" or "DomainServices". But we have another problem. We put a "Service" suffix for every domain service class (Ex. <code>PersonService</code>). Now it seems ugly to have "DomainService" suffix (Ex. <code>DomainServices.PersonDomainServer</code> or <code>DomainServices.DomainPersonService</code>).</p>
  
  <p>So it can be prettier to use "Domain" as namespace while class names show that they're services under domain namespace (Ex. <code>Domain.PersonService</code>).</p>