mit einem Klick
use-cases-and-orchestration
// Orchestrate services and repositories through use cases to implement application-level workflows and business scenarios.
// Orchestrate services and repositories through use cases to implement application-level workflows and business scenarios.
| name | use-cases-and-orchestration |
| description | Orchestrate services and repositories through use cases to implement application-level workflows and business scenarios. |
Use cases orchestrate services:
RegisterUseCase with Execute(ctx context.Context, reqCtx *models.RequestContext) (res *someStructType, error). The res can be a domain model that returns the data from each service's method output, but should not be an HTTP response. The handler can convert it to an HTTP response if needed.See examples/todo_usecases.go for:
Write unit tests in Go following Red-Green-Refactor TDD principles.
Define and implement services that encapsulate business logic with proper constructor-based dependency injection.
Implement HTTP handlers that parse requests, invoke use cases, and format responses following REST conventions.
Build pluggable authentication features using the plugin system with initialization, migrations, routes, and service registration.
Implement repository interfaces for data persistence and abstraction over database operations using Bun ORM.
Wire dependencies using constructor-based dependency injection throughout services, repositories, and handlers.