Mapstruct 1.3.0 is out, so it means that we may use its new builder capability and Immutable.io as the default DTO implementation.
DTO's definition is to be Immutable. also, builder pattern style is better than mutable POJOs. Also, we could trash the fluent style for DTO as builders is nearly the same.
I have read both MapStruct doc about builders and Immutables builders doc and I still don't understand which difficult problem they solve.
I'm afraid this could make JHipster's learning curve stiffer by requiring users to read 70 + 30 pages of docs to avoid writing simple boring boiler plate code that even java beginners could understand without these libs.
It just leads to immutable classes with less code than doing the builder pattern by hand: not much added value as you said, but it enforces to follow the good architectural patterns rules.
Following that reasoning, the learning curve is also higher when we do mappers with MapStruct instead of simply using setters and getters. Idem with some typescript sugar: it's hard for beginners to understand the object = {..,attr} notation and so on....
I know that there is a balance between rookie usability and ease for experts, and I do not really know where the cursor is on that project.
I think that it is time for the community to take a clear decision on that simple question (the persona):
Is it a Hipster project with cool stuff for 10+ years experts or a Websphere AS 5.0 scaffolder for the masses? With all the intermediary level in between.
@Tcharl maybe you could provide a code example, one with the constructor and one with the builder? So we can see more easily the differences?
Isn't that the same motivation behind not using project Lombok?
@jdubois Sure, I'm also curious to see how it works with Json serialization in between ;-).
@aneri90 Not really, we do not use lombok because it's dynamic weaving, not a processor that generates pure POJO
@Tcharl Ok! They have different purposes but i'm pretty sure that Lombok does not make use of dynamic weaving too. It's just an annotation processor.
Lombok is different : it works by modifying the bytecode. The others generate code before compilation.
Not so much discussion about this.
I suggest to close the ticket. We have a lot of other stuff to improve and I'm not sure this one is mandatory.
Are you ok @Tcharl ?
Sure, Will make an example then reopen while ready.
And yes, there is so much more important features to provide :-)
Most helpful comment
It just leads to immutable classes with less code than doing the builder pattern by hand: not much added value as you said, but it enforces to follow the good architectural patterns rules.
Following that reasoning, the learning curve is also higher when we do mappers with MapStruct instead of simply using setters and getters. Idem with some typescript sugar: it's hard for beginners to understand the
object = {..,attr}notation and so on....I know that there is a balance between rookie usability and ease for experts, and I do not really know where the cursor is on that project.
I think that it is time for the community to take a clear decision on that simple question (the persona):
Is it a Hipster project with cool stuff for 10+ years experts or a Websphere AS 5.0 scaffolder for the masses? With all the intermediary level in between.