Design Patterns with Kotlin
summary
Implements the Gang of Four patterns in Kotlin using IntelliJ’s Java→Kotlin converter and decompile-to-Java to inspect bytecode, building singletons, factories, abstract factories, builders, decorators, adapters, strategy/command, observers and a Dagger DI example; Kotlin cuts boilerplate, object as singleton yields thread-safe, reflection-safe singletons, and the Elvis operator (?) for nullable returns fixes factory conversions, but two converter issues appear (observer callback bug and nullability changes); overall examples compile and run after small Kotlin-specific fixes, verified by decompile to Java.
AI-written summary · about
chapters (14)
- 0:00Introduction to design patterns
- 1:28What are design patterns
- 5:01Kotlin introduction and features
- 7:56Singleton pattern in Kotlin
- 14:07Factory method pattern
- 18:50Abstract factory pattern
- 23:16Builder pattern explained
- 27:56Facade and structural patterns
- 30:05Decorator pattern in Kotlin
- 33:03Adapter pattern for legacy code
- 35:24Strategy and command patterns
- 39:55Observer pattern with Kotlin
- 43:18Dependency injection overview
- 45:24Takeaways and conclusion
