Loading...
Loading...
Compare original and translation side by side
SetupRegisterRouteMapSetupRegisterRouteMap{project}/
features/ # or internal/features/ (Go), Features/ (.NET)
{domain}/ # orders/, users/, kvs/
{operation}/ # create/, list/, delete/
handler # Single entry point + orchestration
request/response # DTOs
validator # Input validation (optional)
test # Co-located integration test
internal/ # Feature-private helpers (optional)
platform/ # or Infrastructure/ — shared cross-cutting concerns
middleware/ # Auth, error handling, idempotency
database/ # Connection pooling, circuit breakers
observability/ # Metrics, tracing, structured logging
opqueue/ # Operation queues, outbox patterns (if needed)
main # Composition root wires features + infrastructure{project}/
features/ # 或 internal/features/(Go语言)、Features/(.NET)
{domain}/ # 如orders/、users/、kvs/
{operation}/ # 如create/、list/、delete/
handler # 单一入口点 + 编排逻辑
request/response # 数据传输对象(DTO)
validator # 输入校验(可选)
test # 同目录集成测试
internal/ # 功能私有辅助工具(可选)
platform/ # 或 Infrastructure/ — 共享横切关注点
middleware/ # 身份认证、错误处理、幂等性
database/ # 连接池、断路器
observability/ # 指标监控、链路追踪、结构化日志
opqueue/ # 操作队列、发件箱模式(按需使用)
main # 组合根,连接功能模块与基础设施features/{domain}/{operation}/mainfeatures/{domain}/{operation}/mainplatform/platform/platform/httpx/platform/httpx/| Language | Convention | Signature | DI mechanism |
|---|---|---|---|
| Go | | | Explicit params |
| .NET | | | DI container resolves deps in handler |
| Java/Kotlin | | Controller discovered by component scan | Spring DI (constructor injection) |
| TypeScript | | | Explicit params |
| Python | | | Explicit params or |
SetupV1SetupV2| 语言 | 约定 | 函数签名 | 依赖注入机制 |
|---|---|---|---|
| Go | | | 显式参数注入 |
| .NET | | | 依赖注入容器在处理器中解析依赖 |
| Java/Kotlin | | 组件扫描自动发现控制器 | Spring DI(构造函数注入) |
| TypeScript | | | 显式参数注入 |
| Python | | | 显式参数注入或 |
SetupV1SetupV2