Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Ok, I think I understand this. Follow-up question: In your example, could/should I create methods in class Return such as ValidateCreate(cmd As ProductReturnsCreateCommand) and ValidateUpdate(cmd As ProductReturnsUpdateCommand), so that all validation code resides in class Return? Commented Sep 8, 2021 at 20:10
  • hmm I dont think there is a simple answer to that. Commented Sep 8, 2021 at 20:15
  • 1. re your CQS setup, its arguable that the Validate logic should be on the command Commented Sep 8, 2021 at 20:16
  • 2. If you go for Validate rather than a break down, IsCompleteable IsRefundable, IsSomethingElseable then you have a problem with how to translate the list of validation errors back into concrete things on your view Commented Sep 8, 2021 at 20:18
  • 3. adding these methods to Return arguably invalidates the command pattern in that you cant create new commands without altering Return Commented Sep 8, 2021 at 20:20