Skip to content

Instantly share code, notes, and snippets.

@chrisza4
Created December 29, 2019 04:21
Show Gist options
  • Select an option

  • Save chrisza4/8edca6ba48ece95f0e52c1073f08bb8d to your computer and use it in GitHub Desktop.

Select an option

Save chrisza4/8edca6ba48ece95f0e52c1073f08bb8d to your computer and use it in GitHub Desktop.
abstract class DocumentXRequest {
Optional<int> field1;
Optional<string> fiedl2;
DocumentXDomainModel validate();
}
class DocumentXCreateRequest: DocumentXRequest {
DocumentXDomainModel validate() {
// Validate create request
}
// Domain logic does not belong here
}
class DocumentXUpdateRequest: DocumentXCreateRequest {
DocumentXDomainModel validate() {
// Validate patch request
}
// Domain logic does not belong here
}
class DocumentXDomainModel {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment