The Singleton Pattern - Design Patterns in PHP

preview_player
Показать описание
In this video I walk you through the singleton design pattern, what it is, how it works, and show you a real world problem it was created to solve.

Wikipedia for the singleton design pattern:

------

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

Nice explanation and great video. Hope you continue and complete this series.

nice.
Автор

Awesome content Ollie, thanks for sharing with us.

rachids
Автор

hi great video and great examples!!! quick question, is this example code gonna be available on github or somewhere?

also i think you mentioned it but in laravel usually when i see singleton i usually see Singleton.php file and then all these helper classes such as Config etc relying on that one singleton file. What’s the point of doing what you did with the getInstance in a singular class when you can just have a static class. Alerts::init(text: ‘alert1’, status: ‘bg-danger’)

sorry if poorly worded and i’ve completed missed a key point haha. thanks so much for the great video!

holdenjack
welcome to shbcf.ru