Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 715 Bytes

SPRING-CODING-WHY.md

File metadata and controls

20 lines (14 loc) · 715 Bytes

Why Spring

In these recent years, I have been working on Spring Boot, MVC, Webflux, Cloud, etc.

Why DTO

To enable automatic serialization and deserialization for incoming json payload and outgoing json response.

Why Interface for @Service

Interface is used to oblige business logic and contract on @Service-annotated classes.

Why JPA

To simplify boilerplate of code and query over database CRUD operation.

Why Enum

I prefer to use Enum for helper classes (i.e. classes containing static method only) in order to:

  • Avoid empty constructor
  • Ensure singleton (i.e. no need to create object)

Why Lombok

Despite there is a debate over lombok, I do not mind using it to reduce boilerplate code.