Created
December 29, 2019 04:21
-
-
Save chrisza4/8edca6ba48ece95f0e52c1073f08bb8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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