Singleton pattern

From wikinotes
Revision as of 01:15, 2 May 2020 by Will (talk | contribs) (Created page with "The singleton makes a class behave like a global variable. Once it is instantiated once, re-instantiating it will always return the same instance. This is very useful, but sh...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The singleton makes a class behave like a global variable. Once it is instantiated once, re-instantiating it will always return the same instance.

This is very useful, but should be used sparingly.