Class ScyllaModule
Abstract base class for all Scylla framework modules. Provides the standard implementation of the full module lifecycle, configuration subsystem, dependency injection, and Unity MonoBehaviour integration.
Implements
Inherited Members
Namespace: Scylla.Core.Modules
Assembly: ScyllaCore.dll
Syntax
public abstract class ScyllaModule : MonoBehaviour, IScyllaModule
Remarks
Every Scylla module is a Unity UnityEngine.MonoBehaviour that must be attached as a
component to a GameObject that is a direct child of the
ScyllaBootstrap root object in the scene hierarchy. Violating this
placement rule causes a fatal error and immediately stops Play Mode.
Auto-registration: When a module's Awake() runs it calls
Scylla.Core.Modules.ScyllaModule.RegisterWithFramework(), which validates the scene hierarchy and registers
the instance with ScyllaCore. Derived classes that override
Awake() must call base.Awake(). If the module uses a static
singleton _instance field it should assign that field before calling
base.Awake() so the instance is visible to other subsystems during registration.
Module lifecycle: States progress strictly through the following sequence managed by ScyllaModuleManager:
- Discovered - Component registered in
Awake. - Validated - All hard dependencies confirmed present and version-compatible via ValidateDependencies().
- Initialized - Module resources allocated in Initialize() / OnInitialize().
- Started - Runtime behaviour started in StartModule() / OnStart().
- Enabled - Module fully active after EnableModule() / OnEnableModule().
- Disabled - Module paused; can return to Enabled via EnableModule().
- Shutdown - Resources released; terminal state.
- Error - Entered when ValidateDependencies() fails; only Shutdown() is permitted from this state.
Dependency injection: Override OnInjectDependencies(IScyllaModuleManager) to
resolve and store references to other modules. Use GetRequiredModule<T>(string)
for hard dependencies (throws ScyllaModuleException if absent) and
GetOptionalModule<T>(string) for soft dependencies (returns null if absent).
Configuration subsystem: Modules can expose Inspector configuration slots by decorating ScyllaConfiguration-typed serialized fields with ConfigurationSlotAttribute. Call LoadConfigurationsFromSlots() during OnInitialize() to populate the ConfigurationRegistry, then ApplyConfigFileOverrides() to apply JSON overrides, and finally ValidateAllConfigurations() and ApplyAllConfigurations() to validate and commit settings.
Thread safety: State and IsEnabled are guarded by an internal lock and are safe to read from any thread. All other members must be accessed from the Unity main thread.
Properties
ConfigurationRegistry
Gets the IConfigurationRegistry that holds all configuration assets registered for this module.
Declaration
public IConfigurationRegistry ConfigurationRegistry { get; }
Property Value
| Type | Description |
|---|---|
| IConfigurationRegistry | The module's IConfigurationRegistry, or |
Info
Gets the static metadata descriptor for this module, including its unique ID, display name, version string, description, declared dependencies, and initialization priority.
Declaration
public abstract ScyllaModuleInfo Info { get; }
Property Value
| Type | Description |
|---|---|
| ScyllaModuleInfo | A ScyllaModuleInfo instance that identifies this module to the framework. Must be implemented by every concrete module subclass and must remain constant for the lifetime of the component. |
IsEnabled
Gets a value indicating whether the module is currently in the Enabled state and actively processing runtime behaviour.
Declaration
public bool IsEnabled { get; protected set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
See Also
ModuleManager
Gets the IScyllaModuleManager instance that was injected by the framework during InjectDependencies(IScyllaModuleManager). Use this reference to resolve module dependencies inside OnInjectDependencies(IScyllaModuleManager) via the GetRequiredModule<T>(string) and GetOptionalModule<T>(string) helpers.
Declaration
protected IScyllaModuleManager ModuleManager { get; }
Property Value
| Type | Description |
|---|---|
| IScyllaModuleManager | The framework's module manager, or |
State
Gets the current lifecycle state of this module as tracked by the framework state machine. The state advances sequentially from Discovered through Shutdown and can only regress to Error or Shutdown.
Declaration
public ScyllaModuleState State { get; protected set; }
Property Value
| Type | Description |
|---|---|
| ScyllaModuleState | One of the ScyllaModuleState values reflecting what phase of the lifecycle the module is currently in. Reading this property is thread-safe; it acquires an internal lock before returning the value. |
See Also
Methods
ApplyAllConfigurations()
Applies all ScyllaConfiguration assets in the ConfigurationRegistry to this module in their registration order. Calls OnBeforeApplyConfigurations() before applying and OnAfterApplyConfigurations() after all assets have been applied.
Declaration
public virtual void ApplyAllConfigurations()
Remarks
This method is a no-op when the registry is null or empty. It should be called
as the final step of the configuration initialization sequence, after
LoadConfigurationsFromSlots(), ApplyConfigFileOverrides(),
and ValidateAllConfigurations(). Applying configurations before validating
them may result in invalid settings being applied.
See Also
ApplyConfigFileOverrides()
Applies JSON config-file overrides to every ScyllaConfiguration currently registered in the ConfigurationRegistry, and ensures a default config file exists on disk for each one. Call this during OnInitialize() after LoadConfigurationsFromSlots() and before ValidateAllConfigurations().
Declaration
protected void ApplyConfigFileOverrides()
Remarks
For each registered configuration this method calls:
- ApplyOverrides(ScyllaConfiguration) - reads the layered JSON config files and writes any matching values onto the configuration object.
- CreateConfigFileIfNeeded(ScyllaConfiguration) - writes a default config file to disk if one does not already exist, so the user has a reference file to edit.
The method is a no-op when the registry is null or empty (e.g., before
LoadConfigurationsFromSlots() has been called or when the module has no
configuration assets).
Recommended initialization sequence inside OnInitialize():
Awake()
Unity Awake callback. Triggers auto-registration of this module with the
Scylla framework by calling Scylla.Core.Modules.ScyllaModule.RegisterWithFramework().
Declaration
protected virtual void Awake()
Remarks
Derived classes that override Awake must call
base.Awake(), otherwise the module will not be registered and the framework
will be unaware of it. The recommended pattern is to perform any singleton instance
assignment before the base.Awake() call:
protected override void Awake()
{
_instance = this;
base.Awake();
}
Registration validates that this component's GameObject is a direct child of
the ScyllaBootstrap root and calls a fatal error with Play Mode
termination if the hierarchy requirement is not met.
DisableModule()
Pauses the module's runtime operation without releasing its resources. Transitions the module from Enabled to Disabled and invokes OnDisableModule(). The module can be re-enabled at any time via EnableModule().
Declaration
public virtual void DisableModule()
Remarks
This method is idempotent: if IsEnabled is already false,
it returns immediately without re-entering OnDisableModule().
Pre-condition: State must be Enabled. Any other state produces a warning log and an early return without a state change.
Override guidance: Do not override this method. Override OnDisableModule() instead.
A disabled module consumes zero runtime cost in the framework (no update loops, no event processing) while retaining all allocated resources so it can be re-enabled without re-initialization.
See Also
EnableModule()
Enables the module for active runtime operation. Transitions the module from Started or Disabled to Enabled and invokes OnEnableModule(). Called by the framework after StartModule(), and again whenever the Unity component is re-enabled after being disabled.
Declaration
public virtual void EnableModule()
Remarks
This method is idempotent: if IsEnabled is already true, it
returns immediately without re-entering OnEnableModule().
Pre-condition: State must be Started or Disabled. An Error state is rejected with an error log. Any other state produces a warning log. In both cases the method returns without a state change.
Override guidance: Do not override this method. Override OnEnableModule() instead.
See Also
GetConfiguration()
Returns the primary ScyllaConfiguration asset for this module. Override in derived classes to expose the module's main configuration asset. For modules that declare multiple configuration slots this should return the most important or first-ranked configuration.
Declaration
public virtual ScyllaConfiguration GetConfiguration()
Returns
| Type | Description |
|---|---|
| ScyllaConfiguration | The module's primary ScyllaConfiguration instance, or |
Remarks
The base implementation always returns null. Modules with a single configuration
should override this to return their configuration field value. Modules with multiple
configurations should also override GetConfigurationTypes() and
GetConfigurationFileNames().
GetConfigurationFileName()
Returns the Resources-relative filename (without extension) used to auto-load
the primary configuration asset when no asset has been assigned in the Inspector.
Override in derived classes to specify a custom path inside a Resources folder.
Declaration
public virtual string GetConfigurationFileName()
Returns
| Type | Description |
|---|---|
| string | A |
Remarks
This value feeds the single-configuration backward-compatibility path in GetConfigurationFileNames(). Modules that use multiple configurations should override GetConfigurationFileNames() directly and return one path per type.
GetConfigurationFileNames()
Returns the Resources-relative filenames (without extension) used to auto-load
each configuration asset declared by this module. Override in derived classes that
support multiple configurations. The order of the returned filenames must correspond
to the order of the types returned by GetConfigurationTypes().
Declaration
public virtual string[] GetConfigurationFileNames()
Returns
| Type | Description |
|---|---|
| string[] | An array of |
Remarks
The base implementation wraps the single filename from GetConfigurationFileName() for backward compatibility with the single-configuration pattern. Modules declaring more than one configuration should override both this method and GetConfigurationTypes().
GetConfigurationType()
Returns the Type of the primary configuration expected by this module. Override in derived classes to declare the concrete ScyllaConfiguration subtype the module uses. This information is used by Editor tooling to create or locate the correct configuration asset in the Project.
Declaration
public virtual Type GetConfigurationType()
Returns
| Type | Description |
|---|---|
| Type | The Type of the primary configuration class, which must be a subclass of
ScyllaConfiguration, or |
Remarks
The base implementation returns null. When a module declares multiple
configurations, override GetConfigurationTypes() as well so all types are
reported to tooling.
GetConfigurationTypes()
Returns all ScyllaConfiguration types that this module supports, in the order in which they should be validated and applied. Override in derived classes that register more than one configuration asset.
Declaration
public virtual Type[] GetConfigurationTypes()
Returns
| Type | Description |
|---|---|
| Type[] | An array of Type objects, each of which must be a concrete subclass of
ScyllaConfiguration. Returns an array containing only the type from
GetConfigurationType() when that method returns a non-null value, or an
empty array if the module has no configuration. Never returns |
Remarks
The base implementation wraps the single type returned by GetConfigurationType() for backward compatibility. Modules with multiple configurations should override this method to return all types, and correspondingly override GetConfigurationFileNames() with matching entries at the same indices.
GetConfiguration<T>()
Retrieves a registered configuration asset of the specified type from this module's ConfigurationRegistry.
Declaration
public T GetConfiguration<T>() where T : ScyllaConfiguration
Returns
| Type | Description |
|---|---|
| T | The configuration instance of type |
Type Parameters
| Name | Description |
|---|---|
| T | The concrete ScyllaConfiguration subtype to look up. Must match the exact type that was registered; base-type look-ups are not supported. |
GetOptionalModule<T>(string)
Retrieves an optional dependency module of the specified type from the
IScyllaModuleManager. Returns null gracefully if the module is
not registered, allowing the caller to degrade functionality without aborting startup.
Call this from OnInjectDependencies(IScyllaModuleManager).
Declaration
protected T GetOptionalModule<T>(string moduleID) where T : class, IScyllaModule
Parameters
| Type | Name | Description |
|---|---|---|
| string | moduleID | The unique string identifier of the optional module. Must match the ID of the target module exactly. |
Returns
| Type | Description |
|---|---|
| T | The registered module instance cast to |
Type Parameters
| Name | Description |
|---|---|
| T | The interface or class type that the dependency module implements. Must be a reference type and must implement IScyllaModule. |
Remarks
Always guard the returned value against null before use. If the dependency is
absent the module must operate correctly without it, producing at most a degraded
experience. Do not log a warning or error for a missing optional module here; the
framework logs the absence during ValidateDependencies().
See Also
GetRequiredModule<T>(string)
Retrieves a required dependency module of the specified type from the IScyllaModuleManager. Throws a ScyllaModuleException if the module is not found, enforcing a fail-fast contract for hard dependencies. Call this from OnInjectDependencies(IScyllaModuleManager).
Declaration
protected T GetRequiredModule<T>(string moduleID) where T : class, IScyllaModule
Parameters
| Type | Name | Description |
|---|---|---|
| string | moduleID | The unique string identifier of the required module (e.g., the value from
|
Returns
| Type | Description |
|---|---|
| T | The registered module instance cast to |
Type Parameters
| Name | Description |
|---|---|
| T | The interface or class type that the dependency module implements. Must be a reference type and must implement IScyllaModule. |
Exceptions
| Type | Condition |
|---|---|
| ScyllaModuleException | Thrown when no module with the given |
See Also
Initialize()
Executes the module initialization phase. Transitions the module from Validated to Initialized and invokes the OnInitialize() hook for module-specific setup. Called by the framework after all modules have passed dependency validation.
Declaration
public virtual void Initialize()
Remarks
Pre-condition: The module must be in Validated state. If the module is in Error the call is rejected with an error log and the method returns without making any state change. Any other unexpected state produces a warning log and an early return.
Side effects: After OnInitialize() completes, logs a system-level banner with the module name, version, and description.
Override guidance: Do not override this method. Override OnInitialize() instead to keep the framework's state-machine guards and logging in place.
See Also
InjectDependencies(IScyllaModuleManager)
Stores the IScyllaModuleManager reference and invokes the OnInjectDependencies(IScyllaModuleManager) hook so derived classes can resolve their module dependencies. Called by the framework once, before ValidateDependencies().
Declaration
public virtual void InjectDependencies(IScyllaModuleManager moduleManager)
Parameters
| Type | Name | Description |
|---|---|---|
| IScyllaModuleManager | moduleManager | The framework's IScyllaModuleManager instance. Must not be |
Remarks
Pre-conditions:
- The module must be in Discovered state. Calling from any other state is a no-op with a warning log.
- Dependencies may only be injected once. A second call on the same instance is ignored with a warning log.
Override guidance: Do not override this method. Override OnInjectDependencies(IScyllaModuleManager) to resolve and cache module references using GetRequiredModule<T>(string) and GetOptionalModule<T>(string).
See Also
IsValidStateTransition(ScyllaModuleState, ScyllaModuleState, string)
Determines whether a given state transition is permitted by the module's state machine. Provided as a reference helper and single source of truth for all valid transitions. The base class lifecycle methods use inline state checks for performance and clarity; derived classes may call this method to validate custom state transitions.
Declaration
protected bool IsValidStateTransition(ScyllaModuleState from, ScyllaModuleState to, string operationName)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaModuleState | from | The current ScyllaModuleState before the transition. |
| ScyllaModuleState | to | The target ScyllaModuleState to transition to. |
| string | operationName | A human-readable name for the operation attempting the transition, used in error log
messages to aid debugging. For example, |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
The complete set of valid transitions is:
- Discovered -> Discovered (InjectDependencies - state unchanged)
- Discovered -> Validated (ValidateDependencies succeeds)
- Discovered -> Error (ValidateDependencies fails)
- Discovered -> Shutdown (cleanup without initialization)
- Validated -> Initialized (Initialize)
- Validated -> Shutdown (cleanup before start)
- Initialized -> Started (StartModule)
- Initialized -> Shutdown (cleanup before enable)
- Started -> Enabled (EnableModule)
- Started -> Shutdown (cleanup without enabling)
- Enabled -> Disabled (DisableModule)
- Enabled -> Shutdown (Shutdown while enabled)
- Disabled -> Enabled (EnableModule re-enables)
- Disabled -> Shutdown (Shutdown while disabled)
- Error -> Shutdown (only permitted transition from Error)
- Shutdown -> Shutdown (idempotent)
All other transitions are invalid and indicate a bug in the calling code.
LoadConfigurationsFromSlots()
Scans this module's type hierarchy for fields decorated with ConfigurationSlotAttribute and registers each discovered ScyllaConfiguration with the ConfigurationRegistry. Call this during OnInitialize() to populate the registry before calling ApplyConfigFileOverrides(), ValidateAllConfigurations(), and ApplyAllConfigurations().
Declaration
protected void LoadConfigurationsFromSlots()
Remarks
The method inspects both public and non-public instance fields on the runtime type. For each field marked with ConfigurationSlotAttribute:
- If the field is not assignable to ScyllaConfiguration, a warning is logged and the field is skipped.
-
If the field value is
nulland ResourcePath is non-empty, the asset is loaded fromResourcesand written back to the field for future access. - If a configuration is found (either already assigned or auto-loaded), it is registered with the registry.
-
If a configuration is missing and Required
is
true, a warning is logged. The module is responsible for treating this as a fatal condition if appropriate.
Recommended initialization sequence inside OnInitialize():
LogConfigurationOrigin<T>(T, string)
Logs a consistent origin message for a single configuration asset and applies any JSON config-file overrides when the config-file system is enabled. Call this during OnInitialize() immediately after loading a primary configuration asset to produce log output that matches the style used by ScyllaBootstrap for Core and Logger configurations.
Declaration
protected void LogConfigurationOrigin<T>(T config, string baseName) where T : ScyllaConfiguration
Parameters
| Type | Name | Description |
|---|---|---|
| T | config | The loaded configuration asset, or |
| string | baseName | A short, human-readable display name used as the log prefix, e.g. |
Type Parameters
| Name | Description |
|---|---|
| T | The concrete ScyllaConfiguration subtype being logged. |
Remarks
Behavior summary based on inputs:
-
configisnull: logs"[baseName] Initialized from defaults (no config asset assigned)."and calls CreateDefaultConfigFileIfNeeded<T>(). -
configis non-null and IsEnabled istrue: calls ApplyOverrides(ScyllaConfiguration), which handles its own origin logging, and then calls CreateConfigFileIfNeeded(ScyllaConfiguration). -
configis non-null and IsEnabled isfalse: logs"[baseName] Initialized from config asset."and calls CreateConfigFileIfNeeded(ScyllaConfiguration).
Note that config-file creation (CreateConfigFileIfNeeded(ScyllaConfiguration)) is always attempted regardless of whether the config-file override gate is open. This ensures a default file exists on disk for the user to edit even when overrides are disabled.
OnAfterApplyConfigurations()
Called by ApplyAllConfigurations() immediately after all configurations in
the registry have had their Apply method invoked. Override to react to the
completed configuration change, such as propagating new settings to subsystems that
depend on them.
Declaration
protected virtual void OnAfterApplyConfigurations()
OnBeforeApplyConfigurations()
Called by ApplyAllConfigurations() immediately before iterating over the
registry and calling Apply on each configuration. Override to perform any
pre-application setup, such as resetting runtime state to default values before new
settings are written.
Declaration
protected virtual void OnBeforeApplyConfigurations()
OnDisableModule()
Override this method to implement module-specific logic for when the module is paused. Called by DisableModule() when transitioning from Enabled to Disabled. Use this hook to suspend active processing, pause event subscriptions, or otherwise reduce the module to a low-cost idle state without releasing resources.
Declaration
protected virtual void OnDisableModule()
Remarks
A disabled module incurs zero framework overhead. All allocated resources are retained
so the module can return to Enabled via
EnableModule() without re-initialization.
Do not call base.OnDisableModule() - the base implementation is empty.
See Also
OnEnableModule()
Override this method to implement module-specific logic for when the module becomes active. Called by EnableModule() when transitioning to Enabled. This hook is invoked both during the initial startup sequence (after StartModule()) and whenever the module is re-enabled after being disabled via DisableModule(). Use this hook to activate systems, restore event subscriptions, or resume processing that was paused in OnDisableModule().
Declaration
protected virtual void OnEnableModule()
Remarks
Do not call base.OnEnableModule() - the base implementation is empty.
See Also
OnInitialize()
Override this method to implement module-specific initialization logic, such as loading configuration assets, allocating resources, and setting up internal subsystems. Called by Initialize() when the module transitions from Validated to Initialized. All hard module dependencies are available and fully initialized at this point.
Declaration
protected virtual void OnInitialize()
Remarks
Typical implementation pattern for modules using the configuration slot system:
protected override void OnInitialize()
{
LoadConfigurationsFromSlots();
ApplyConfigFileOverrides();
ValidateAllConfigurations();
ApplyAllConfigurations();
}
Do not call base.OnInitialize() - the base implementation is empty.
See Also
OnInjectDependencies(IScyllaModuleManager)
Override this method to resolve and cache references to other modules that this module depends on. Called by InjectDependencies(IScyllaModuleManager) when the IScyllaModuleManager is first made available to the module, before ValidateDependencies() and OnInitialize(). Use GetRequiredModule<T>(string) for hard dependencies and GetOptionalModule<T>(string) for soft dependencies.
Declaration
protected virtual void OnInjectDependencies(IScyllaModuleManager moduleManager)
Parameters
| Type | Name | Description |
|---|---|---|
| IScyllaModuleManager | moduleManager | The framework's IScyllaModuleManager instance, identical to the ModuleManager property. Provided as a parameter for convenience so the override does not need to reference the property by name. |
Remarks
Store resolved module references in private fields on the derived class. The cached references remain valid for the full lifetime of the module because no module can be removed from the registry once registered.
private IMyOtherModule _otherModule;
protected override void OnInjectDependencies(IScyllaModuleManager moduleManager)
{
_otherModule = GetRequiredModule<IMyOtherModule>("ScyllaOtherModule");
}
Do not call base.OnInjectDependencies() - the base implementation is empty.
See Also
OnShutdown()
Override this method to implement module-specific teardown logic, such as releasing unmanaged resources, unsubscribing from events, and disposing subsystems. Called by Shutdown() after DisableModule() has been called (if the module was enabled) and before the state transitions to Shutdown.
Declaration
protected virtual void OnShutdown()
Remarks
After Shutdown() returns, the module is in a terminal state and no further
lifecycle methods will be called. Do not attempt to use framework services from within
this method as other modules may have already been shut down.
Do not call base.OnShutdown() - the base implementation is empty.
See Also
OnStart()
Override this method to implement module-specific startup logic that should run after all modules have been initialized. Called by StartModule() when the module transitions from Initialized to Started. Use this hook to wire up cross-module event subscriptions or start coroutines that depend on all modules being ready.
Declaration
protected virtual void OnStart()
Remarks
Do not call base.OnStart() - the base implementation is empty.
See Also
RegisterConfiguration(ScyllaConfiguration)
Registers a ScyllaConfiguration asset with this module's internal
ConfigurationRegistry. Silently ignores null inputs.
Call this during OnInitialize() when loading configuration assets manually
rather than through LoadConfigurationsFromSlots().
Declaration
protected void RegisterConfiguration(ScyllaConfiguration configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaConfiguration | configuration | The configuration asset to register. If |
Remarks
Registering a configuration makes it retrievable via GetConfiguration<T>() and includes it in the results of ValidateAllConfigurations() and ApplyAllConfigurations(). The registry is created lazily on the first successful registration.
Shutdown()
Shuts down the module, releasing all resources and transitioning to the terminal
Shutdown state. If the module is currently in
Enabled state, DisableModule() is called
first before invoking OnShutdown().
Called by the framework in reverse initialization order during application teardown,
and also automatically from Scylla.Core.Modules.ScyllaModule.OnDestroy() if the module's
GameObject is destroyed at runtime.
Declaration
public virtual void Shutdown()
Remarks
Idempotency: If the module is already in Shutdown, this method returns immediately with no side effects.
Discovered state: If called while still in Discovered (the module was never initialized), a warning is logged, the state transitions to Shutdown, and OnShutdown() is not called to avoid operating on an uninitialized module.
Override guidance: Do not override this method. Override OnShutdown() to release module-specific resources.
See Also
StartModule()
Executes the module startup phase. Transitions the module from Initialized to Started and invokes the OnStart() hook for runtime behaviour startup. Called by the framework after all modules have been initialized.
Declaration
public virtual void StartModule()
Remarks
Pre-condition: The module must be in Initialized state. Calls from Error are rejected with an error log; calls from any other state produce a warning log. In both cases the method returns without a state change.
Override guidance: Do not override this method. Override OnStart() instead.
After this method returns the Unity OnEnable bridge will immediately call
EnableModule() if the component is enabled, transitioning the module
to Enabled.
See Also
ValidateAllConfigurations()
Validates all ScyllaConfiguration assets registered in the ConfigurationRegistry and optionally performs cross-configuration validation via ValidateCrossConfiguration().
Declaration
public virtual ConfigurationValidationResult[] ValidateAllConfigurations()
Returns
| Type | Description |
|---|---|
| ConfigurationValidationResult[] | A combined array of ConfigurationValidationResult entries from both
individual configuration validation and any cross-configuration rules. Returns an empty
array when the registry is |
Remarks
Results from this method should be inspected for entries with Error severity before proceeding to ApplyAllConfigurations(). Fatal validation errors should cause the module to abort initialization.
See Also
ValidateCrossConfiguration()
Override this method to implement validation logic that spans multiple configuration assets and cannot be expressed within a single Validate() override. For example, verifying that a resolution setting in one configuration is compatible with a quality tier specified in another.
Declaration
protected virtual ConfigurationValidationResult[] ValidateCrossConfiguration()
Returns
| Type | Description |
|---|---|
| ConfigurationValidationResult[] | An array of ConfigurationValidationResult entries describing any
cross-configuration constraint violations. Return an empty array (the base
implementation) when all cross-configuration invariants hold. Never return |
Remarks
This method is called automatically by ValidateAllConfigurations() after per-configuration validation completes. Results from this method are combined with the per-configuration results and returned together.
See Also
ValidateDependencies()
Validates that all declared module dependencies are present and version-compatible. Transitions the module from Discovered to Validated on success, or to Error on failure. Called by the framework before Initialize().
Declaration
public virtual bool ValidateDependencies()
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Hard dependencies (Hard):
A missing hard dependency or version mismatch is a fatal condition. The module
transitions to Error and false is returned.
The framework will abort startup.
Soft dependencies (Soft):
Missing soft dependencies are logged at Info level only. A soft-dependency
version mismatch is logged at Warning level. Neither condition causes the
method to return false; the module degrades gracefully.
Pre-condition: The module must be in
Discovered state. Calls from any other state
produce a warning log and return false.
Override guidance: Do not override this method unless you need
custom dependency validation beyond what the Dependencies
list supports. If you do override it, ensure you call base.ValidateDependencies()
to retain the framework's built-in checks.