Singleton - Good or Bad?

preview_player
Показать описание
Singleton is one of the most controversial design patterns and in this video, I've tried to analyse if it is actually bad, or some bad practices which makes it look bad. I've discussed the concept, implementation, examples and downsides of Singleton. Also tried to answer the question that if Singleton is so bad, why it has been accepted as a Design Pattern.

Article mentioned in the video 👇🏼
Рекомендации по теме
Комментарии
Автор

Would love to have more videos on Design Pattern. Thanks for having such a quality content.

preetipandey
Автор

Very Very well explained video. I am making an app and at first I too was going to be using it to store variables I needed globally, but turned out what I was looking for was AppStorage. But, now I need to make sure that only one instance of a class is made, and I appreciate that instead of just saying "Singletons are always bad" you explained the reasoning behind it. Thanks a ton!! :)

SwiftUIForBeginners_TY
Автор

Hi Pallav, great explanation about singleton. We are still waiting for the 6th video in the series of mastering concurrency.

riyazahemad
Автор

Hi thanks for the detailed video. i have a query like, if you said manage userdata or coredata functions with singletone then what will be the other approach to manage such kind of usage ? where we need to save or fetch same data multiple times .

badalshah
Автор

Very useful, I was using as Global data store. I will change the way now.

afaaqahmedsaqi
Автор

Hi, I like the way you explain.
Can you please create video on all architecture patterns and which to use when

shlokkadam
Автор

Hi, You told about Singleton, But you didn’t explained what should be use instead of Singleton..?

If I am not going to use singleton then what should I use. What patterns similar to Singleton.

KumarLav
Автор

Thank you brother, such a nice content and well explained🤞🤞

puneetpal
Автор

Before understanding Dependency injection if we checkout this video then DI becomes more

RajrkSunny
Автор

When i visit this video it has 996 views, 82 likes & 10 comments in 2 days.. wish it will reach more people.. thanks for video & see ya in future 😃✌
30.08.2022 08:39 pm ist

azhagurajaallinall
Автор

"Breaks SOLID"... man i'm sick of solid rules sometimes... we are in 2024 we can skip some of the solid rules... also Apple is using singleton in UserDefaults. Everyone uses userdefaults so this mean we break the solid shitprinciples?

Spacer-lj