Is it possible to reuse my Singleton annotation ac...
# kotlin-inject
l
Is it possible to reuse my Singleton annotation across nested components? I am not sure I understand the problems of allowing the same scope on a child and parent component.
l
I think I understand... what do you recommend on this case? Suppose I have a dbComponent providing a Singleton-annotated instance of my database. How can I use this component to create an ApplicationComponent which will also use the database as a single instance?
p
Just add the db component inside the app component?
(so just annotate the db with @DbScope)
l
Yeah that’s fine. I failed to convey that it was a sample issue, what would be the strategy if one has several components and they all have an intricate dependency of each other. That’s probably several singleton annotations with different names