When defining APIs or your app's different layers you may reach a point that needs the input to be type-safe.
In this video, you will learn how to use the Kotlin language inline class (a.k.a value class) to achieve a maintainable type-safe API.
#Android #AndroidDevelopment #Kotlin #KotlinDevelopment #SoftwareDevelopment #InlineClass #ValueClass #TypeSafety #ADT
▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
0:00 - Intro
0:39 - What is "inline class" used for?
1:00 - Differences with "type alias"
1:29 - Data class is not a good solution!
1:48 - How to define an "inline class"?
3:25 - "inline class" serialization
3:54 - Under the hood and mangling concept
4:47 - Conclusion
5:05 - Outro
▬ Links and References ▬▬▬▬▬▬▬▬▬▬▬
► Kotlin inline class documentation:
https://kotlinlang.org/docs/inline-cl...
► Design Notes on Kotlin Value Classes:
https://github.com/Kotlin/KEEP/blob/m...
► From Inline to Value Classes video:
• From Inline to Value Classes
▬ Follow me on ▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Twitter - / @mohsenoid
► Mastodon - https://mastodon.social/@mohsenoid@an...
► Medium - / mohsenoid
► Podcast - https://android-developer-tips.castos...
Watch video How to use inline class (a.k.a value class) in Kotlin to achieve type safety? online, duration hours minute second in high quality that is uploaded to the channel Android Developer Tips 26 December 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 1,116 times and liked it 47 visitors.