1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chore(docs): update coding_standards to avoid singletons

Fix #5339
This commit is contained in:
Anthony Bilinski 2018-09-16 19:40:22 -07:00
parent 91bdd40f10
commit 25ed12c96a
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -390,6 +390,16 @@ extern "C" {
#include <limits>
```
### Singletons
Do not introduce new singleton classes. Prefer to move code in the direction
of fewer singleton classes over time.
Singletons complicate destruction, complicate making multiple instances of
something in the future, i.e. having two Tox profiles loaded at once is
difficult to implement in qTox because both Settings and Profile are singleton.
Singleton's also make unit testing and reasoning more difficult by more
tightly coupling classes.
## Documentation