Currently DTO to model conversion is done manually inside the service layer,
mixing conversion logic with business logic.
A dedicated mapper layer would improve separation of concerns and make the
code cleaner and easier to maintain.
Tasks
- Create mapper classes for each resource:
- BookMapper
- CustomerMapper
- EmployeeMapper
- LoanMapper
- SectionMapper
- Move all DTO to model and model to DTO conversion logic out of services into mappers
- Consider using MapStruct library to auto-generate mapper implementations
Currently DTO to model conversion is done manually inside the service layer,
mixing conversion logic with business logic.
A dedicated mapper layer would improve separation of concerns and make the
code cleaner and easier to maintain.
Tasks