Java / MapStruct Java Interview questions part 2
Explain the lifecycle of a MapStruct mapper from source code to runtime call?
A MapStruct mapper passes through distinct build-time and run-time phases, and understanding the split explains why most mapping problems show up as compiler diagnostics rather than production bugs.
Steps A through E happen once per build, entirely before the application ever runs. Steps F through H happen repeatedly at runtime but involve nothing more than an ordinary object instantiation and plain method calls - MapStruct itself is not present on the runtime classpath's active code path at that point, only its small annotation/runtime support library.
More Related questions...