Originally Posted by tyler_cracker
ok i think i finally understand what you want to do: you basically want global state.
i guess for something small or for interface things it could make sense, but basically it's a slippery slope and you're better off without it.
Global state is a legitimate requirement though. It's just that doing it through static variables is dangerous for reasons like race conditions, parallel design, etc. We always implement it through an interface, and provide two impls, one through a local singleton pattern and another through some sort of service (db, keystore, cache, whatever). seems to work well.