Member-only story
Java Horror Stories: The mapper BUG
How the ModelMapper library almost got me fired
During my first real-world project built with Spring, I took the worst decision ever, to pick ModelMapper as a library to turn a Model into a DTO.
Simply put, DTOs (Data Transfer Objects) are used to define the shape of the data that the client sends to the server or receives from it. They act as containers that carry data between different parts of an application — especially across network boundaries — without containing any business logic. In a way, DTOs serve as a contract or interface through which all your data flows when entering or leaving your application.
Developing the MVP
Everything was going good from the developer's perspective. We also had pretty solid integration tests that covered most of the processes, every business logic was working as intended and manual testing also didn't reveal any bugs related to the backend.
First week in Production — Heaven
The day comes, services are live, and half company users start inserting their data. Everything was going good, a success, fast responses, no bugs reported, and all statistics on the dashboard were tracing everything correctly, numbers were growing, it's a success!!