Το pattern Singleton διασφαλίζει ότι μια κλάση έχει μόνο μια instance και παρέχει ένα global σημείο πρόσβασης σε αυτήν. Χρησιμοποιείται όταν ακριβώς ένα αντικείμενο πρέπει να συντονίζει κάτι (μια ρύθμιση, ένα connection pool, έναν logger), αν και είναι και κάπως αμφιλεγόμενο.
Τι κάνει το Singleton
SINGLETON → guarantee a class has only ONE instance, with global access to it:
→ the class controls its own instantiation (private constructor)
→ returns the SAME instance every time it's requested
→ for: things there should only be ONE of, accessed from many places
