Is there a convenient way to make `@Component` ann...
# spring
c
Is there a convenient way to make
@Component
annotations work with kotlin objects and automatically make that bean a singleton? I typically create a wrapper class to annotate as
@Component
to wrap my kotlin objects.
j
you mean the
object
keyword kind of object?
c
yes
j
Why bother adding the @Component? The object will already be available to any code that needs it without any Dependency Injection
4