Naming your project is a key part of the process. Naming your project clearly makes it easier to maintain and read.
This article has compiled a list of the most common suffixes for Spring Boot projects, which you can use as you develop depending on your team’s habits and project requirements
Entity database model (not recommended, no suffix recommended)
UserEntity.java
BookEntity.java
TodoEntity.java
Copy the code
Model Database Model (not recommended, no suffix recommended)
UserModel.java
BookModel.java
TodoModel.java
Copy the code
❌ DTO The correct practice should not use the suffix DTO, because DTO (Data Transfer Object) is a general term, ambiguous meaning
❌ UserDTO. JavaCopy the code
Response represents a data request to return data
CarsResponse.java
BooksResponse.java
Copy the code
Resource Indicates the Resource returned by the external Restful interface
CarsResource.java
BooksResource.java
Copy the code
Request Indicates a data Request
LoginRequest.java
UpdateUserInfoRequest.java
Copy the code
Command indicates the requested operation
SendSMSCommand.java
GeneratePdfCommand.java
Copy the code
Assembler represents the utility class that is packaged into a Resouce from the Entity and other data
UserAssembler.java
OrderAssembler.java
Copy the code
Converter represents a utility class for converting various Dtos to one another
BookingConverter.java
OrderConverter.java
Copy the code
Mapper represents a utility class for converting various Dtos to one another
BookingMapper.java
OrderMapper.java
Copy the code
Repository Creates a database operation class
BookRepository.java
OrderRepository.java
Copy the code
The Configuration Configuration class
BookConfiguration.java
OrderConfiguration.java
Copy the code
Controller API External interface class
BookController.java
OrderController.java
Copy the code
Service Data operation Service class
BookService.java
OrderService.java
Copy the code
Client Third-party service invocation class, usually used in the Feign interface class
AwsClient.java
SendGridClient.java
Copy the code
Util utility class
StringUtil.java
DateUtil.java
Copy the code
Exception Exception class
LoginException.java
DatabaseException.java
Copy the code