You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,12 +9,12 @@ A minimalistic approach to dependency injection. Basically the idea is that you
9
9
10
10
### The `@Scope` and `@Singleton` annotations are ignored.
11
11
12
-
Instead, you have one simple rule:
12
+
Instead, you have the "same key, same bean" rule:
13
13
14
14
> If two beans of the same *key* are injected by the same component, then they are the same bean instance.
15
15
16
-
Here, "same key" means "same type and same qualifier".
17
-
You can still obtain multiple instances of a bean by injecting `Provider<TheBean>`.
16
+
Here, "same key" means "same type" or, if a qualifier is used, "same key and same qualifier".
17
+
The SKSB-rule may seem restrictive at first, but please note that you can inject `Provider<TheBean> theBeanProvider` (and not just `TheBean theBean`). Calling `theBeanProvider.get()` will give you a freshly wired "distinct" bean instance every time.
0 commit comments