When developing an app, there are numerous cases when you need to model and represent data. Consider a simple client program that fetches blog posts from a server. To show those blog posts in the client, you need to have some representation of a blog post object. This object may contain the title, body, and author, while more complex sites would put even more into that object.
In other languages, modeling these data objects requires a lot of boilerplate code and numerous fields to hold the data. As with most things Kotlin, Kotlin data classes represent these objects in an elegant, streamlined manner.
Whether you’re just starting with Kotlin or have been using the language for a long time, this lesson will show you how to get started using these classes. Additionally, you’ll go over some concrete use cases for Kotlin data classes and consider the pros and cons of using this paradigm versus something else.
See forum comments
This content was released on May 22 2024. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous: Quiz: Use Companion Objects
Next: Instruction
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.