Gang of Four patterns in Kotlin.
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
Inspired by https://github.com/mariofusco/from-gof-to-lambda
Blog posts: - Part 1: https://dev.to/lovis/gang-of-four-patterns-in-kotlin - Part 2: https://dev.to/lovis/gang-of-four-patterns-in-kotlin---slight-return
Watch me talk about it: https://youtu.be/xxGCVVtMVn4 (2018 @code.talks hamburg)
| Pattern | Kotlin | | --- | --- | | Builder |
applyfunction / named constructor parameters | | Decorator | Extension Functions / function composition | | Interpreter |
sealedclasses | | Iterator | operator functions | | Observer | observable delegate | | Prototype | Data class | | Singleton |
objectdeclaration | | Strategy | functions | | Template Method | (top-level) functions | | Visitor | Pattern Matching /
ℹ️ If you import the project into intelliJ, make sure to uncheck "Create separate module per source set"!