Skip to content

Instantly share code, notes, and snippets.

@dilab
Created August 2, 2017 03:30
Show Gist options
  • Save dilab/36e3097a9ce1041aae334a52f17c25b4 to your computer and use it in GitHub Desktop.
Save dilab/36e3097a9ce1041aae334a52f17c25b4 to your computer and use it in GitHub Desktop.
Fat controller, fat service and fat entity
## 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