Domain driven design #2
-
Hi Ben and thanks for good content! Related to https://www.gobeyond.dev/packages-as-layers/ What do you think about structuring according to the ideas from https://en.m.wikipedia.org/wiki/Domain-driven_design It's popular in Java, where we often need to structure big projects and I see good application in Python here https://github.com/cosmicpython/book Would Go project benefits from it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @svetli-n! I've seen some people advocate for DDD in Go but I personally find it difficult to implement well. The implementations I've seen separate domains into different packages and duplicate domain types between them (although only keep the fields that are relevant to that domain). I think it could be useful to separate applications into subdomains that align to the application architecture if you're using something like microservices. In that case, each microservice has its own separate package tree and possible share some common domain types in a root package. |
Beta Was this translation helpful? Give feedback.
Hi @svetli-n! I've seen some people advocate for DDD in Go but I personally find it difficult to implement well. The implementations I've seen separate domains into different packages and duplicate domain types between them (although only keep the fields that are relevant to that domain).
I think it could be useful to separate applications into subdomains that align to the application architecture if you're using something like microservices. In that case, each microservice has its own separate package tree and possible share some common domain types in a root package.