单例模式

單例模式
dānlìmóshì
noun

Meanings

  1. 1 singleton pattern (OOP design pattern)

Examples

Shùjùkù liánjiē chí tōngcháng shǐyòng dānlì móshì.
Database connection pools usually use the singleton pattern.
Dānlì móshì bǎozhèng yí ge lèi zhǐ yǒu yí ge shílì.
The singleton pattern ensures a class has only one instance.

Tips

usage
One of the 23 GoF (Gang of Four) design patterns. literally 'single instance' — the pattern forces a class to have exactly one instance globally. Interview-favourite topic in Chinese software engineering.

Stroke Order

dān
shì