Applying the Factory Method and Abstract Factory Patterns in Kotlin

preview_player
Показать описание
Make object creation more flexible with the Factory Method and Abstract Factory design patterns! Today, we'll look at code that could benefit from these patterns, we'll apply a traditional version of them from the classic Gang of Four Design Patterns book, and then we'll see how we can modernize them with Kotlin's language features.

🚀 Get the inside scoop on everything I'm working on - join my new email newsletter!

📺 Watch Episode #2 of the TypeAlias Show Livestream:

📚 Chapters
00:00 Introduction
00:22 Example Code
01:48 Refactoring to a Factory Method Pattern
06:37 Refactoring to an Abstract Factory Pattern
12:14 Modernizing the Patterns with Kotlin
18:28 Wrap-up
Рекомендации по теме
Комментарии
Автор

Hi Dave, I'm so thankful for your time and effort, I like your content so much. Thanks!

josenavio
Автор

It’s a mind-blowing explanation of how Kotlin simplifies these patterns. And I love the way you explain complex concepts so easily.

funkypopper
Автор

Masterfully explained. Loving this series.

smreha
Автор

"Seeds of complexity". Love this quote!

jameslorenzen
Автор

Thanks Dave, these videos are so good. I have been using Kotlin in old Java ways, not really using the language features.

navdeepsinghbedi
Автор

this is awesome, so well explained. thank you!

joannajanaszek-yv
Автор

Great video, keep going! Wait for more!

marcincylkowski
Автор

Great tutorial! It is easy to understand for beginners like me. Thank you Dave.

thuraaung
Автор

Brilliant video as always, thanks for the great content!

HoussamElbadissi
Автор

Your videos are crazy, you are cazy! In a good way!

LightDante
Автор

great learning experience, thank you Dave!

AdityaLadwa
Автор

Great examples and walkthrough. I love using lambdas in constructor arguments for concrete class implementation. Really cuts down on the code and noise.

gileee
Автор

Nice! Love it!
The level int could be replaced with an Enum. This will intorduce more readable names for it like (Title, Subtitle, etc.) as well as removing the need to check the parameter.

DeliOZzz
Автор

15:21 createLink function (line 4) have parameters text and url swapped in usage.
I recommend using a value class instead of a String in this case.

skarloti
Автор

Hey Dave thanks for this great series I appreciate that.
I asked you for kotlin dsl series
including convention plugins and etc pls

ArshadAli-hdwe
Автор

hey Dave will your Kotlin book be available to buy as paperback inthe future?

gabrielm
Автор

I have a question about Java it self.
Projects like Valhalla, Lilliput, Leyden etc are going to influence Kotlin too or they are completely irrelevant to Kotlin?

gregandark
Автор

Hello!
It's possible to write Kotlin in a way to never call the GC?

gregandark
Автор

Why would you even need these patterns in Kotlin? I mean they were mostly invented when languages like Java didn't have a lot of syntax tooling. Just use DSL, it will be cleaner and easier.

James_Kirk
join shbcf.ru