Composite Installers - mariaheine/Zenject-But-Wiki GitHub Wiki
🔥 notice below mention of 'Extenject' instead of 'Zenject', this is already present in original Zenject documentation, how did that slip get in there, did zenject original creator cooperate on Extenject? consider moving to extenject since Zenject is kinda forlorn, what changes does it introduce? i suppose this is because original author of zenject must have merged in changes from extenject which is cool
Extenject allows you to compose your installers into tree structures. The so called composite design pattern. Where the
CompositeMonoInstaller
> andCompositeScripableObjectInstaller
are the nodes and the child installers the leaves. A special use case - that's worthwhile to mention - is for smooth installation and updating of your asset packages in other projects.
CompositeInstaller is the composite pattern of Zenject installers.
CompositeInstaller can compose other installers and can be used as follows:
- A reusable installer of other installers group
- A loosely-coupled installer of other installers
- A proxy installer to installers for some features
For example, Suppose you use a CompositeScriptableObjectInstaller asset in a package provided by another developer.
If the developer add some installers to the CompositeScriptableObjectInstaller asset in the package, all you need to do is update the package and you can receive features of the new installers.
- Add "CompositeMonoInstaller" component to any GameObject
- Set "MonoInstaller"s (including "CompositeMonoInstaller") to "CompositeMonoInstaller"
- Set "CompositeMonoInstaller" to any "Context"

- Select
Create -> Zenject -> Composite Scriptable Object Installer
to create the asset
- Set "ScriptableObjectInstaller"s (including "CompositeScriptableObjectInstaller") to "CompositeScriptableObjectInstaller"
- Set "CompositeScriptableObjectInstaller" to any Context
- If any circular references are found in a composite installer, the property on the inspector will get red as a warning