DDD Infrastructure services

后端 未结 4 1610
小鲜肉
小鲜肉 2021-01-30 04:48

I am learning DDD and I am a little bit lost in Infrastructure layer.

As I understand, \"all good DDD applications\" should have 4 layers: Presentation, Application, Dom

4条回答
  •  失恋的感觉
    2021-01-30 05:14

    Maybe it will help to see a potential project structure.

    Possible assembly or package structure:

    Project.Domain
    Project.Infrastructure.Data
    Project.Infrastructure.Components
    Project.Infrastructure.Services

    Possible namespace or folder structure:

    Project.Domain
    -n- Modules
    ----n- Account
    -------f- Account.xx
    -------f- AccountRepository.xx
    -------f- Contact.xx
    ----n- Marketing
    -------f- RegionRepository.xx
    -n- Shared
    -n- Services

    Project.Infrastructure.Data (OR-Mappers)
    -n- Tables
    -n- Views
    -n- Procedures
    -n- Functions

    Project.Infrastructure.Components (Generic)
    -n- Mail
    -n- Cryptography
    -n- UI

    Project.Infrastructure.Services (Special Operations)
    -f- DoingSomethingService1.xx
    -f- DoingSomethingService2.xx
    -f- DoingSomethingService3.xx

    Domain Entities and Value Types do not use Domain Services. The Application Layer uses the Services of the Domain. The Domain Repository objects use the Infrastructure.Data objects to return Domain objects.

提交回复
热议问题