Simple Factory Method Design Pattern

preview_player
Показать описание
Learn how to make your code DRY in one easy step. It could be used as the first step to a more involved refactoring or as a final solution to not repeating yourself.

And while it's technically not a design pattern but a programming idiom instead (or at least it's what the Head First: Design Patterns book says it is), it's still worth mentioning, since it's one of the EASIEST solutions to remove duplication from your code and not have your classes instantiate other classes within themselves.

#Python #DesignPatterns #SimpleFactoryMethodPattern
-------------------------------------------------------------------------------------
📰 *Sign up for my newsletter*

🖥️ *Free Courses to Learn Programming*

🛒 *Products I recommend*

*Connect with me*

#codevev
Рекомендации по теме
Комментарии
Автор

That was useful, I was thinking yesterday about how to make my code “more DRY” and here it is.

CoentraDZ