The lonely class design pattern (Singleton)

The lonely class design pattern (Singleton)

You know your only #best #friend whom you #trust with your #secrets and him only so #secrets stays as it's, and you can't maintain to have two friends with same level #trust because that costs a lot of jokes and communication and even more is #trust be there for them and also if the #secret went out you will exactly know who spill it out.

That's The #Singleton #Design #Pattern

That's The Singleton Design Pattern


It's commonly used with Authentication & Authorization also DB Connections.

In briefly it's used when you have a class or and object that need to be resolved one time only.

Consider it as your #best #friend and #trust it to do what's meant to do.

BTW A lot of #developers consider the #Singleton pattern an #antipattern.

Do you have another opinion you want to share? don't.


要查看或添加评论,请登录

Omar A.的更多文章

社区洞察

其他会员也浏览了