Fanilog
06/07/2021, 6:05 PMRemoteUser
received by a backend to a User
object used by the business logic inside an app)? I used to do it via Interface + Implementation
interface IUserMapper {
fun remoteToEntity(remote: RemoteUser): User
}
, what is the real benefit than doing it directly with an extension function ?
fun RemoteUser.toUser() =
...
(except mocking) 🤔gildor
06/08/2021, 4:32 AMexcept mockingWell, it’s only part of it, it just an abstraction, which allows you to replace implementation (mocking is one of such use cases), and itэы your decision, do you want more abstract and flexible code or you want it more simple