Applying the State Pattern in Kotlin

Описание к видео Applying the State Pattern in Kotlin

When our objects behave differently in different states, then it can be helpful to apply the State Pattern. Today, we'll look at code that could benefit from the State Pattern, we'll apply a traditional State Pattern from the classic Gang of Four Design Patterns book, and then we'll see how we can modernize it and reduce boilerplate by using some of Kotlin's language features.

✨ New to Kotlin? Start your journey here: https://typealias.com/start/
... or pick up the new Leanpub Edition for offline access and more! https://book.typealias.com/

🚀 Get the inside scoop on everything I'm working on - join my new email newsletter!
Sign up here: https://newsletter.typealias.com/

📺 Watch Episode #1 of the TypeAlias Show Livestream:
https://youtube.com/live/S_JKbmN_A8o

📚 Chapters
00:00 Introduction
00:16 Example Code
02:16 Classic State Pattern
06:50 Modernized State Pattern in Kotlin
11:58 Wrap-up

Correction:

11:03 Inside the `println()` on line 13, I should have printed `$it` instead of `$email`.

Комментарии

Информация по комментариям в разработке