+ 2

Why singleton is blamed more than celebrated

Hi I am aware that singleton design pattern is useful in few scenarios like database connection , application logger as well as global application settings. However, It is singleton which gets criticized more than it is celebrated. Below are some key points for its criticism: 1. Breaks Single responsibility ---> How ? Can you please share more insights? 2. Breaks testability ----> Why it hinders to test singleton?

2nd Apr 2025, 2:06 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
1 Risposta