Mapper merging is substantially handled by mutable Builder objects, allowing Mappers
themselves to remain immutable. However, the external merging logic is applied to
Mappers, meaning that each Mapper needs to hold sufficient state to reconstruct a
Builder and then pass off the merging logic there. In addition, things like ObjectMapper
split their merging logic between Mapper and Builder objects.
Mappers are long lived objects, and the additional state that they need to hold to
support merging can cause significant memory pressure.
We can remove enormous amounts of state from Mapper objects if we migrate merging
logic entirely to Builders. This is a major undertaking, and so needs to be split into
several parts:
Mapper merging is substantially handled by mutable Builder objects, allowing Mappers
themselves to remain immutable. However, the external merging logic is applied to
Mappers, meaning that each Mapper needs to hold sufficient state to reconstruct a
Builder and then pass off the merging logic there. In addition, things like ObjectMapper
split their merging logic between Mapper and Builder objects.
Mappers are long lived objects, and the additional state that they need to hold to
support merging can cause significant memory pressure.
We can remove enormous amounts of state from Mapper objects if we migrate merging
logic entirely to Builders. This is a major undertaking, and so needs to be split into
several parts: