vendredi 14 mai 2021

C# namespace organization by domain or utility purpose

What type of namespace you prefer ? For example in my company we use something like this

Project.AgentCabinet
-- Services
-- Managers
-- Handlers
-- Consumers
-- Etc

Namespace organization above looks like for utilitary purpose, not representing domain stuff and i think about something like this

Project.AgentCabinet.Domain
-- Users
---- Services
---- Handlers
---- Consumers
---- Etc 
-- Documents
---- Services
---- Managers
---- Files

In organization above Documents represent some domain stuff inside of AgentCabinet "context"

Event it might look like this, from common to specific purpose

Project.AgentCabinet.Domain
-- Users
---- Contractors
------ Services
------ Managers
------ Remoting
-- Documents
---- Invoices
------ Services
------ Messaging
------ Managers
---- Revocation
------ Services
------ Handlers
------ Utils
------ Extensions

A long time ago I found article about two types of namespace organization, but i lost it

So what organization is most preferable, because it's not framework or library, there is just services/etc with business logic ? I think last variant more useful when digging into project and it's more look like a DDD(Domain Driven Design) namespace organization

Aucun commentaire:

Enregistrer un commentaire