In my company we’re told to stop using global variables since our services are singleton and that’s lead to problems however I gave manager my humble opinion that we should create an annotation that’ll use ThreadLocal under-the-hood while initializing and will set/remove elements automatically however I couldn’t convince him using that, I just wanna know whether the advice I gave was better or not.
New contributor
Muhammad Haris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.