galatea-associates / fuse-starter-java

Starter project for Galatea java projects
17 stars 73 forks source link

Consider incorporation of a data mapping library #217

Closed GalaFirsh closed 4 years ago

GalaFirsh commented 6 years ago

Issue Description

Many of our REST applications are required to transform data from the existing schema of their underlying data store into the desired domain model(s) to be exposed via REST API. There are ~several~ many tools out there that aid with this which don't involve the standard manual solution: "Most programmers will develop some sort of custom mapping framework and spend countless hours and thousands of lines of code mapping to and from their different data objects" (http://dozer.sourceforge.net/documentation/whymap.html)

It would be great if FUSE can provide an example of which tool to best use for this situation.

This guy seems to have gone through a lot of the same debate and settled on either Selma or MapStruct, finally going with Selma:

Selma and MapStruct also have much better performance compared to Orika, ModelMapper, and Dozer:

Debate on MapStruct VS Selma by the authors themselves on StackOverflow:

Libhunt comparison between many of the tools:

As a counterpoint to all of this, and why one should simply manually convert the objects:

Design

[Description of the root cause for the issue and how to resolve it. Should be complete before Review is approved]

Documentation Changes

[Description of changes necessary to the Fuse documentation due to the changes in response to this issue. Should be complete before Review is approved]

Test Evidence

[include relevant tests and output. Should be complete before Review is approved]

Validation in Develop -- [Proof issue is resolved in Develop. Should be complete before Issue is closed]

cbaltera commented 4 years ago

See links above for information, no generally applicable best practice (very situational).

cbaltera commented 4 years ago

An additional link: https://www.baeldung.com/java-performance-mapping-frameworks