Closed msamoylov closed 3 years ago
The single-responsibility principle might be violated here. Not sure if the NewTraining function should be doing validation routines.
NewTraining
https://github.com/ThreeDotsLabs/wild-workouts-go-ddd-example/blob/22c0a25b67c4669d612a2fa4a434ffae8e35e65a/internal/trainings/domain/training/training.go#L25
Actually, it is expected 😉
This is ensuring that "The Second Rule of DDD lite: always keep a valid state in the memory" is met.
The single-responsibility principle might be violated here. Not sure if the
NewTraining
function should be doing validation routines.https://github.com/ThreeDotsLabs/wild-workouts-go-ddd-example/blob/22c0a25b67c4669d612a2fa4a434ffae8e35e65a/internal/trainings/domain/training/training.go#L25