preparation for interview

49 阅读1分钟

StudentManager

  1. How you organize your system, can you berifly describe the architecture of your project? How is your project layered? What are the responsibilities of each layer?

My project adopted a typical layered architecture, which is mainly divided into the Controller layer, Service layer and DAO layer. Controller layer is responsible for processing HTTP request, Service layer is for business logic, DAO layer is for database access. I use Springboot as framework and combine it with MySQL database and JPA for data persistance.

Controller layer:

use annotation like @RequestBody,@PathVariable,@RequestParam to parse the request parameters passed by api. then call the service layer to execute business logic and return json response data.

use annotation @Validated and @Valid to validate request body and path parameter, prevent illegal data entering the system, ensure parameters comply with the business rules.

use annotation @ExceptionHandler to handle exception uniformly, and provide standardized error info, so that API can return a consistent error format.

follow RESTful design principles and use semantic URLs.