【发布时间】:2021-03-24 11:54:12
【问题描述】:
您好,我有一个关于 ddd 层的问题: 我基本上在以下位置构建了我的文件夹:
├───presentations
│ ├───controllers
│ ├───helpers
│ ├───protocols
├───modules
│ ├───domain #interfaces of implemented command handler
│ ├───commands #Commands interfaces & abstract implementations
│ ├───errors #Errors & Error Types
│ ├───events #Events interfaces & abstract implementations
│ ├───services #services interfaces & abstract implementations
│ ├───infrastructure
│ ├───persistence #repositories implementations
但我对应该在哪一层创建我的用例、命令处理程序、命令实现、事件实现存在疑问。 我的问题是我是否应该在我的模块 / ** / 基础设施文件夹中创建 或者我是否应该创建一个文件夹,如:
├───DATA or APPLICATION
│ ├───dtos #Commands interfaces & abstract implementations
│ ├───commands #Commands interfaces & abstract implementations
│ ├───events #Events interfaces & abstract implementations
│ ├───useCases #services interfaces & abstract implementations
另一个问题:我的表示层,控制器应该在那个层上吗?
【问题讨论】: