Skip to content

How to structure multiple features inside a single domain using DDD β€” does the plugin support feature-level vertical slices?Β #155

@wizardnet972

Description

@wizardnet972

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions