Which design pattern restricts the instantiation of a class to a single instance and provides a global point of access to it?

  • Factory Pattern
  • Singleton Pattern
  • Observer Pattern
  • Abstract Factory Pattern
The Singleton design pattern restricts the instantiation of a class to a single instance. It provides a global point of access to that instance, making it useful when you want to ensure there's only one instance of a class throughout your application, like a configuration manager, a database connection, or a logging service.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *