-
Notifications
You must be signed in to change notification settings - Fork 1
InstanceCreation
how Salta creates Instances
Creating instances is a recursive process. It starts with the request of the user for an instance of a specific type. While creating an instance, further dependencies might be discovered, which need to be resolved as well.
The request for an instance is represented as a CoreDepenencyKey, which can represent a request for both an instance of a type or an instance needed to by an injection point.
The CoreInjector contains a list of CreationRules which are applied until one of them succeeds. These core creation rules are typically configured by the creationPipeline of the standard module (look in StandardInjectorConfiguration. The default pipeline has the following steps:
- static bindings: try to match a binding configured explicitley in the modules
- creation rules: try the creation rules until the first one succeeds. Not to be confused with the creation rules of the core injector
- jit bindings: create a jit binding key and apply the jit binding rules
The Salta wiki. It was copied from the Guice Wiki and adapted to Salta.
- Home
- Why Dependency Injection?
- Getting Started
- Bindings
- Scopes
- Injections
- Injecting Providers
- AOP
- Speed
- Frequently Asked Questions
- Extending Salta
- Internals
- Best Practices
- Community