Mapper implementation with Extension functions #427
Closed
marcosscarpim
started this conversation in
Ideas
Replies: 1 comment
-
|
Hello, Marcos! In the past, we already have a discussion on how to better create mappers. The reason we decided to use a mapper With that said, I don't think there is a right or wrong solution here. It's a matter of preference because the boilerplate will need to be stored somewhere. Thank you for your insight! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What do you think about creating Mappers between modules using Extension functions for Model classes? I saw this implementation recently and it looked so clean in code.
I mean, instead of creating a "CategoryMapper" class with methods for conversion, we create extension function in this file:
''''
fun RepoCategory.toLocal(repoCategory: RepoCategory): LocalCategory = LocalCategory(...)
''''
Beta Was this translation helpful? Give feedback.
All reactions