Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reusing the same class in container wiring with different containers #705

Unanswered
darrenrahnemoon asked this question in Q&A
Discussion options

Say I have a class with the following dependency

class Foo:
 dependency: Provide['my_dependency']

Can two containers running in the same process reuse the same class to resolve the dependency to something different?
i.e

class ContainerOne:
 my_dependency = Singleton(SomeDependencyClass)
 wiring_coniguration.... same
class ContainerTwo:
 my_dependency = Singleton(SomeOtherDependencyClass)
 wiring_coniguration.... same

Is Provide['my_dependency'] stashing annotations about what to inject in the class itself or in the container that is crawling through the files to wire things together?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /