A spring boot RESTful service project. Treated as a programming play ground where to try and find good coding principles of clean code.
GoogleTechTalks: The Clean Code Talks
-
Too many conditions? Using inheritance and polymorphism instead! (When behavior changes based on state or parallel conditionals are in multiple places in code. It’s good to use polymorphism!)
- 1-1. Using HandlerMethodArgumentResolver for getting user data.
- 1-2. Using Inheritance for role control. Comparing with AOP, it has better maintainability and testability.
- 1-3. Strategy Pattern for different team creation controllers. Application works differently through wiring components differently.
- 3-1. Factory Method Pattern
- 3-2. Builder Pattern
- 3-3. Composite Pattern
- 3-4. Strategy Pattern (Using polymorphism and generics)
- 4-1. Integration testing with SpringRunner and H2 in-memory database.
- 4-2. Object Mother Pattern
- 4-3. Unit testing with Mockito.