Skip to content

Commit

Permalink
Update README.md (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
h908714124 authored Dec 18, 2023
1 parent e29c937 commit 2706c9b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Instead there's the following rule:
> If two beans of the *same type* and *same qualifier* are injected by the *same component*, then they are the *same instance*.
Intuitively this means a component injects the same bean instance everywhere (unless of course you're using qualifiers or inject a provider).
For example in the `CoffeeApp`, if there were more beans that request the logger, they would get the same logger instance as `CoffeeMaker`.

If you want to re-use a bean instance across multiple components, or multiple instances of the same component, use a `@Factory` or a `@Builder` to pass it around.
Components will prefer using an existing bean instance over creating a new one.
Expand Down

0 comments on commit 2706c9b

Please sign in to comment.