-
Notifications
You must be signed in to change notification settings - Fork 1
Capsule
Garrett W edited this page Aug 31, 2021
·
3 revisions
- Auto-wiring
- Built-in factory callback functionality
- Post-instantiation method calls / modification / decoration / setter injection
- Class substitutions
- Lazy-resolving ctor params, such as env vars, container objects, post- method calls, etc.
- Named instances and storing outside values/objects in the container are trivial
- Definition provider interface for classes that will work with the Definitions object to provide rules
- Definitions object uses magic methods to set rules as if their class names were the names of object properties, along with a fluent interface
- Ctor params can be configured by position, name, or type
- Using magic methods for setting stuff in this way is a bit unnatural so I probably wouldn't do it.
- Definition provider interface is definitely a good idea. It enables modules of code to be easily plugged into the container.