Introduction
Avalanche.Module introduces a plugin architecture with following capabilities:
- Exporting features
- Importing features
- Feature installer
- Module dependencies
Interoperability with (by feature installer):
- Microsoft.Extensions.DependencyInjection
- Microsoft.Extensions.HostBuilder
- Microsoft.Extensions.Configuration
- Google.Protobuf any types
- Godot.Node
- Avalanche.Service
Module is a singular unit that exports a feature. Module may install to several locations in application container, e.g. configuration, localization, gui, scene or dom tree.
Any class can operate as a module.
public class Module
{
public static Module Instance { get; } = new ();
// .. features are exported as fields ..
// .. pre- and post- install actions are also fields ..
// .. exporting doesn't need any assembly dependency ..
}
Features are exported in different ways:
- [Export<T>] attribute
- [ServiceDescriptor<T>] attribute
- [AnyType] attribute
- As fields in Module class
Class libraries:
- Avalanche.Module.dll contains implementations.
- Avalanche.Module.Abstractions.dll contains interfaces.