Object Mapping Observations and the Deprecated Dozer

In 2013 I wrote a post: "In Case Dozer Or BeanUtils Are Working Well You Have A Problem." Most projects back then copied identical object hierarchies, usually persistent JPA entities and transient Data Transfer Objects, back and forth with the decoupling as the primary goal.

Object copying was intended to act as design insurance: potential JPA / persistence layer changes don't have to be visible in the data transfer layer. Since 2013 I have had the chance to review some of the "object copying" projects and noticed the lack of such incompatible changes. In the vast majority of all cases, identical objects are still copied back and forth. Dozer is not an invasive framework, but at least requires the usage of the org.dozer.Mapper. Depending on the design, there can be hundreds of such dependencies. Dozer is deprecated. You will find the following notice on https://github.com/DozerMapper/dozer (6.5.2):
"The project is currently not active and will more than likely be deprecated in the future. If you are looking to use Dozer on a greenfield project, we would discourage that."

Dozer suggest the use of mapstruct or modelmapper frameworks instead.

However, consider removing any superfluous 1:1 mapping logic altogether before migrating dozer to another mapping framework. With Java Records, JSON-P, or Java Records and JSON-B you get interesting out-of-the-box alternatives to an external library and so dependency.


Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments