I came across this post (and more like it) claiming extensions to be a good, or at least different, solution for mapping DTO’s.

Are they though? Aren’t DTO’s supposed to be pure data objects? I’ve always been taught to seperate my mappings in special mapping services or mapping libraries like MapStruct and ModelMapper for implementing the good practice of “seperation of concerns”.

So what about extensions?

  • abbadon420@lemm.eeOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    9 months ago

    I was suspecting something like that. I’ll be looking into it a bit more.

    I also notice some difference in what’s considered “best practice” between Java and C#, so I’m not sure what’s actually best practice haha. Probably somewhere in the middle, I suppose.