• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Design Patterns by
Q:
What are the drawbacks of using singleton design pattern?

1 Answer

0 votes
by
The major drawbacks of using singleton design pattern are:

a)Singleton causes code to be tightly coupled. The singleton object is exposed globally and is available to a whole application. Thus, classes using this object become tightly coupled; any change in the global object will impact all other classes using it.

b)They hide dependencies instead of exposing them.

c)Singleton Pattern does not support inheritance.

d)Singleton principle can be violated by techniques such as cloning. If an application is running on multiple JVM’s, then, in this case, Singleton might be broken.

Related questions

0 votes
asked Oct 16, 2019 in Design Patterns by DavidAnderson
0 votes
asked Oct 16, 2019 in Design Patterns by DavidAnderson
...