Data Objects in Kotlin
<p>Data objects are a new Kotlin language feature introduced in version <code>1.7.20</code> and are currently planned to be released in version <code>1.9</code>. We’ll take a closer look at what they are and what issue they are trying to solve.</p>
<h2>What issue are data objects solving?</h2>
<p>Below we have a typical example of a sealed class hierarchy where we are using a <code>sealed interface</code> (we could also use a <code>sealed class</code>) to define possible states for a Profile screen. We are using a <code>data class</code> for the success state and an <code>object</code> for error and loading states since we don’t need any additional information.</p>
<p><a href="https://medium.com/@domen.lanisnik/data-objects-in-kotlin-1a549bfad657"><strong>Website</strong></a></p>