Hi @manfredsteyer @L-X-T π
Iβm using the Nx DDD plugin and I have a question about the recommended structure when a domain contains many features.
Today, a domain library often ends up looking like this:
libs/portfolio/domain/
application/
feature-a.facade.ts
feature-b.facade.ts
infra/
feature-a.api.ts
feature-b.api.ts
...
This means all application logic for all features lives inside a single application/ folder.
From a DDD perspective this is fine, but from a vertical slice perspective it feels wrong, because each feature does not have its own self-contained slice.
My question
Does the DDD approach (as you teach it) support β or even encourage β having multiple feature-level vertical slices inside one domain?
Something like:
libs/portfolio/feature-plan-list/
application/
infra/
ui/
libs/portfolio/feature-portfolio-edit/
application/
infra/
ui/
Where each feature contains everything it needs, without mixing with other features.
What Iβm trying to understand
- Should a domain with many features have multiple feature libs, each representing a vertical slice?
- Or should all feature application logic stay inside a single domain lib under
application/, infra/, etc.?
- What is your recommended best practice for large domains with many separate capabilities?
Thanks!
Looking forward to your guidance π
If you want, I can also generate:
β
a shorter version
β
a more opinionated version
β
or add diagrams / examples
Just tell me.