Static variable vs singleton
问题 I'm making Java REST application. I wonder how should I implement my services - should I use static service variables for whole application or make services as singletons like it was made in Spring MVC. Is there any difference between singleton object and initializing object only once during application? 回答1: should I use static service variables for whole application or make services as singletons It depends. You have to ask yourself two questions to come up with an answer: Where is that