annotation
Which name is better?
Domain.PersonServiceDomainServices.PersonServiceDomainServices.PersonDomainService (consider a few longer names, e.g. PersonDomainServiceModelDecorator )
or something else?
Situation
We have a structure in which for each layer there are some base classes. Ex. Repository, domain services, user interface, etc.
Each logical level has a name that is used as its namespace:
- "Data" for the data level containing the repositories; Ex.
Fx.Data.DbContextRepository - "Services" for the service level (not web); Ex.
Fx.Services.CrudService - "Web.UI" for the web interface layer; Ex.
Fx.Web.UI.Controllers.CrudController
We also follow the same rule for final projects with some additional layers:
- "Data" Example.
Project.Data.PersonRepository - "Services" Example.
Project.Services.PersonService - "Web.UI" Example.
Project.Web.UI.Controllers.PersonController - "Objects" for objects of the first code; Ex.
Entities.Person - "Models" for object models; Ex. Models.Person.Criteria,
Models.Person.PersonDeleteModel
My focus is on the Domain Service layer, but any ideas about other levels are also welcome.
Finally, we conclude that “Services” is not suitable for “Domain Services”, as this may cause ambiguity between the word “Web Service” or “Domain Service”.
Now we change the namespace "Services" to "Domain" or "DomainServices". But we have one more problem. We put the suffix "Service" for each class of the domain service (example PersonService ). The "DomainService" suffix now seems ugly (example DomainServices.PersonDomainServer or DomainServices.DomainPersonService ).
So it may be prettier to use “Domain” as a namespace, while class names indicate that they are services in a domain namespace (example Domain.PersonService ).
c # architecture naming domainservices
Amir karimi
source share