I've already written a couple of Spring Boot application (at the moment, one for web, one using JavaFX and a handful CLI applications). While all work as expected, I currently struggle with one particular concept of desktop or command line applications: The @Scope annotation for @Services and @Components.
I recently read a lot of why singletons are "evil" or at least undesired, but for desktop applications I currently see no other way to implement it, since most of the time a single instance is enough in these kinds of applications.
In Guice I would create an (non-static and non-final) instance in my module. In Spring I use @Scope("singleton").
What I want to know now: Is this a clean solution? Is there any other solution at all?
Regards, Daniel