https://kotlinlang.org logo
Title
k

Ketan

06/20/2018, 4:13 PM
Hi Guys, I am new to Kotlin. I have a question. What would be memory impact if I use object AndroidDTO { data class Request(name: String) data class Response(api: String) } Instead of two different data classes as below: data class Request(name: String) data class Response(api: String) In presenter, I am accessing Android.Request("Lollipop") and getting response. The real question is when view(Fragment) is replaced by another view(Fragment), Android object would be in memory until application gets closed or would be garbage collected when view and associate presenter references are gone.
r

rkeazor

06/20/2018, 8:47 PM
I don’t see a reason to put data classes inside a singleton object…