-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
#Test22-Jpa
Description
While exploring the codebase to contribute, I noticed a few architectural and structural aspects that could be improved to better align with Spring Boot and Spring Data JPA best practices. Addressing these would improve maintainability, readability, and scalability of the project.
Observations
1)Package / Folder Structure
*The current package structure is not clearly organized by layers (controller, service, repository, domain/entity).
*A well-defined layered or feature-based structure would make the codebase easier to understand and extend, especially for new contributors.
2)Controller Directly Autowiring Repository
*Some controllers directly autowire repository interfaces.
*This bypasses the service layer and tightly couples the web layer with the persistence layer.
*Introducing a service layer would help enforce separation of concerns and make business logic reusable and testable.
3)Usage of @RequestMapping Instead of HTTP-Specific Mappings
*@RequestMapping is used across endpoints regardless of HTTP method.
*Using method-specific annotations such as @GetMapping, @PostMapping, @PutMapping, and @DeleteMapping would improve code readability and make endpoint intent clearer.
I would be happy to work on this refactor and submit a pull request if the maintainers agree with the approach.
Looking forward to your feedback.
