Say it like this
- We implemented it as a singleton pattern
- Make sure the logger is a singleton
- Avoid singletons when possible; use dependency injection instead
Use it at work
Code review
- Do we need a singleton here? It makes testing hard.
- The database client is a singleton.
Explaining
- A singleton has only one instance in the app.
- Use dependency injection instead of a singleton.
Debugging
- The singleton keeps state between tests.
- The singleton isn't thread-safe.
Don't say this
Singleton by definition restricts the class to a single instance, not multiple instances.
Practice
Try it
4 quick exercises
1. Your team is discussing how to manage the application's configuration file. What would you say?
2. The logging service is implemented as a _______ to ensure all modules write to the same log file.
3. Which sentence uses 'singleton' incorrectly?
4. Rewrite this in natural tech English using 'singleton': 'We need a design where there is only one object that manages all the caching for the whole application.'
Say it out loud
Phrase 1 of 3
"We implemented it as a singleton pattern"
We don't save your recording. The word check uses your browser's speech recognition.
More about singleton
Real examples(3)
- in a code review
"This class should be a singleton since we only need one instance managing all user sessions."
- in a standup
"I refactored the configuration manager into a singleton so all modules access the same config data."
- in a team meeting
"We're debating whether to keep our database connection as a singleton or switch to a connection pool."
More mistakes(2)
Handle with care. Often confused with just having one instance of something; singleton is a specific design pattern with controlled instantiation, not merely having a single object.
- ✕We will singleton the database connection.✓We will implement the singleton pattern for the database connection.
Singleton is typically a noun in this context. You do not use it as a verb directly; you implement the pattern or make something a singleton.
- ✕This is just a singleton object.✓This is a singleton instance managed by the singleton pattern.
Any object can exist alone; a singleton is specifically about the design pattern that enforces and controls single instantiation.
Other forms(3)
- singleton noun
"The cache manager is implemented as a singleton."
- singletons noun
"We are reviewing all the singletons in our codebase to reduce coupling."
- singleton adjective
"We used a singleton pattern for the logging service."
Often used with(5)
- singleton pattern · The design pattern itself; most common phrasing when discussing the architectural approach.
- implement a singleton · To code or apply the singleton pattern to a class or resource.
- singleton instance · Refers to the actual single object created by the singleton pattern.
- make something a singleton · To apply the singleton pattern to a previously non-singleton class.
- singleton class · A class designed and implemented with the singleton pattern.
Similar words(3)
- single instance · More general; describes having one instance but does not specify the design pattern mechanism.
- global instance · Emphasizes the global accessibility aspect but lacks the control and restriction implied by singleton.
- static instance · Relates to how singletons are often implemented but is not a full synonym for the pattern itself.
Opposites(3)
- multiton
- factory pattern
- prototype pattern
Questions(5)
- What does singleton mean in software engineering?
- A singleton is a design pattern that restricts a class to have only one instance throughout the entire application and provides a global way to access that instance. It is commonly used for resources like loggers, database connections, or configuration managers that should exist in only one place.
- How do you use singleton in a sentence at work?
- You typically say: 'Make this a singleton,' 'Implement the singleton pattern for this class,' or 'This service is a singleton instance.' For example: 'We implemented the cache manager as a singleton to avoid duplicate instances.'
- Is singleton formal or informal?
- Singleton is neutral to formal. It is a technical term used in both casual code reviews and formal architectural discussions. In professional settings, people often say 'singleton pattern' to be more precise.
- Why do developers use singletons?
- Developers use singletons to control resource usage, ensure consistency, and provide a single point of access to shared resources. However, many modern developers prefer dependency injection because singletons can make code harder to test.
- What is the difference between a singleton and just having one object?
- A singleton is a design pattern that actively prevents the creation of more than one instance and provides controlled access. Simply having one object in your code does not guarantee it will remain singular if the code is refactored or if other developers do not know about the constraint.



