Created
August 2, 2017 03:30
-
-
Save dilab/36e3097a9ce1041aae334a52f17c25b4 to your computer and use it in GitHub Desktop.
Fat controller, fat service and fat entity
This file contains 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
## Pros and Cons of fat controller | |
### Pros | |
+ Fast dev time, no extra layer | |
### Cons | |
+ No reusable code for different interfaces (API, CLI and Controller) | |
## Pros and Cons of fat service class | |
### Pros | |
+ Reusable code for different interfaces (API, CLI and Controller) | |
### Cons | |
+ Extra layer to maintain | |
+ Hard to write unit tests (still need a lot of integration tests) | |
## Pros and Cons of fat entity class with service layer | |
### Pros | |
+ Reusable code for different interfaces (API, CLI and Controller) | |
+ Easy to write unit tests | |
### Cons | |
+ Extra layer to maintain | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment