-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
23 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Multiple Containers | ||
|
||
As each container has its own state and does not modify the underlying classes, use of multiple containers is possible. | ||
A few things to keep in mind when using multiple containers. | ||
|
||
* The default `wireup.container` is simply an instance just like any other. | ||
* If a service belongs to multiple containers you can use decorators on them, but it is preferable you manage | ||
register services without the decorators. | ||
* To wire parameters use initialization context or the `wire` method. The `wire` method is not bound to any single | ||
container but merely provides hints as to what should be injected. These hints can be read by any container | ||
when calling autowire. | ||
* Use of `@autowire` decorator with multiple containers is unsupported. To bind parameters and services to a method | ||
call `instance.autowire(fn)()`. The autowire method will return a function where all the arguments that the container | ||
knows about are passed. |