user-1120/kopring
Kotlin Spring Rules
- Follow Kotlin coding conventions
- Use nullable types wisely (e.g.,
Type?
)
- Prefer immutability (use
val
instead of var
)
- Leverage Kotlin standard library functions
- Use data classes for model objects
- Embrace functional programming paradigms
- Follow Spring Boot naming conventions (CamelCase, PascalCase)
- Use feature-based package structure (instead of layer-based)
- Prefer constructor-based dependency injection
- Use Spring stereotype annotations appropriately (@Service, @Repository, etc.)
- Implement global exception handling with @ControllerAdvice
- Use SLF4J for logging instead of
System.out.println
- Write unit tests using JUnit 5 and Mockito