Videos

Learning Zenject: Bindings

This video takes a closer look at Zenject bindings, focusing on how to configure them using built-in configuration methods.

https://youtu.be/qhjC-KWfZRI

Zenject defines dependencies using injections.

Injections tell Zenject which objects a class needs in order to function. At startup, Zenject scans the application for these injections, and fills each one using an object created by the Container.

Injections only tell Zenject which types of objects the Container should create, not how to create them. That information is provided by Zenject bindings, through a process called Dependency Mapping.

Zenject Bindings

Dependency Mapping is the binding of a type to an instance. In other words, you must tell the Container which implementation to use for each type of object that it creates.

Furthermore, you must tell the Container how to create or locate the objects that Zenject needs to inject.

Binding statements are instructions that tell the Container the type, construction method, and frequency that should be used for each object that it creates. These binding statements, along with optional configuration methods, are what enable the Container to provide the necessary objects for injection.

Resources