#protocols #java #jackson #messaging #design
Jackson mix-ins are crucial to clearly separate application layers according to the onion architecture (popularised further by Rob Martin), without code duplication and boilerplate. According to onion architecture marshalling would sit in infrastructure level and domain objects should not be dependent on messaging infrastructure.
Another important use case would be if you do not control source code for serialised objects, but rather import them as library. In this case it is impossible to annotate imported class.