adam-mcneilly
09/26/2019, 3:25 PMexpect
values in the MPP and then typealias it to the real thing? I got that idea from seeing how this post handled parcelize: <https://aakira.app/blog/2019/04/kotlin-mpp-android-parcelable-en/>
data class User(
@Embedded val location: Location
)
data class Location(
@Embedded val details: LocationDetails
)
If I swap out Location, room yells at me.Lou Morda
09/26/2019, 4:09 PMadam-mcneilly
09/26/2019, 4:14 PMJeremy
09/26/2019, 6:34 PMadam-mcneilly
09/26/2019, 7:30 PMJeremy
09/26/2019, 7:47 PMadam-mcneilly
09/26/2019, 7:49 PMUser
entities that serve different purposes, but in many cases may be the same? 🤔Jeremy
09/26/2019, 7:50 PMadam-mcneilly
09/26/2019, 7:56 PMclass UserCardViewModel {
private val user: User? = null
}
So I get the abstraction you're talking about for UI stuff. I guess the problem in question now is data. I want a class that I can annotate with room annotations, but that I don't necessarily want to share because iOS doesn't care.
So I guess I have to decide if I'd want to pursue a different persistence idea like sqlite or maybe I should have my own implementation of a User that can support being persisted to a database.Jeremy
09/26/2019, 7:58 PMadam-mcneilly
09/26/2019, 8:03 PMUserCardViewModel
would do. The POJO should strictly just have the data I want, and that class is responsible for translating it to something to display inside a card view.
But I guess I'm answering my own question now, because the same idea would also apply for persistence. If we don't need both platforms to know about a Room annotation, then maybe just the platform that does should implement it? 🤔 Idk I feel like it can go either way I just might have to pick one and go down the rabbit hole a little bit.User.kt
and PersistableUser.kt
?Jeremy
09/26/2019, 8:09 PMadam-mcneilly
09/26/2019, 8:14 PMJeremy
09/26/2019, 8:18 PMLou Morda
09/26/2019, 8:50 PMJeremy
09/26/2019, 9:36 PMLou Morda
09/26/2019, 9:40 PMJeremy
09/26/2019, 9:48 PMkpgalligan
09/27/2019, 2:28 AMadam-mcneilly
09/27/2019, 1:51 PMkpgalligan
09/27/2019, 2:16 PMadam-mcneilly
09/27/2019, 2:37 PMkpgalligan
09/27/2019, 2:40 PMadam-mcneilly
09/27/2019, 2:47 PMkpgalligan
09/27/2019, 2:49 PMadam-mcneilly
09/27/2019, 2:49 PMkpgalligan
09/27/2019, 2:50 PMadam-mcneilly
09/27/2019, 2:52 PMkpgalligan
09/27/2019, 2:56 PMadam-mcneilly
09/27/2019, 3:01 PM