26 lines
472 B
Markdown
26 lines
472 B
Markdown
# Command Design
|
|
|
|
Design effective commands for CQRS.
|
|
|
|
## Best Practices
|
|
|
|
### ✅ DO
|
|
|
|
- Use records for immutability
|
|
- Include all required data
|
|
- Validate at boundaries
|
|
- Use descriptive names
|
|
- Make commands self-contained
|
|
|
|
### ❌ DON'T
|
|
|
|
- Don't query in commands
|
|
- Don't expose domain models
|
|
- Don't make commands mutable
|
|
- Don't use DTOs as commands
|
|
|
|
## See Also
|
|
|
|
- [Best Practices Overview](README.md)
|
|
- [Commands Documentation](../core-features/commands/README.md)
|