this post was submitted on 02 Apr 2024
7 points (100.0% liked)

Kotlin

671 readers
2 users here now

Kotlin is a statically typed programming language for the JVM, Android, JavaScript, and native.

Subreddit rules:

Resources:

founded 1 year ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 7 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.