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...
Смотрите видео How to use inline class (a.k.a value class) in Kotlin to achieve type safety? онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Android Developer Tips 26 Декабрь 2021. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 1,116 раз и оно понравилось 47 посетителям.