Class ModuleDependencySolver
Used by ModuleInitializer to get the load sequence for the modules to load according to their dependencies.
Namespace: Sartorius.SAF.Presentation.Modularity
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class ModuleDependencySolver
Properties
View SourceModuleCount
Gets the number of modules added to the solver.
Declaration
public int ModuleCount { get; }
Property Value
| Type | Description |
|---|---|
| int | The number of modules. |
Methods
View SourceAddDependency(string, string)
Adds a module dependency between the modules specified by dependingModule and dependentModule.
Declaration
public void AddDependency(string dependingModule, string dependentModule)
Parameters
| Type | Name | Description |
|---|---|---|
| string | dependingModule | The name of the module with the dependency. |
| string | dependentModule | The name of the module dependingModule depends on. |
AddModule(string)
Adds a module to the solver.
Declaration
public void AddModule(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name that uniquely identifies the module. |
Solve()
Calculates an ordered vector according to the defined dependencies. Non-dependant modules appears at the beginning of the resulting array.
Declaration
public string[] Solve()
Returns
| Type | Description |
|---|---|
| string[] | The resulting ordered list of modules. |
Exceptions
| Type | Condition |
|---|---|
| CyclicDependencyFoundException | This exception is thrown when a cycle is found in the defined depedency graph. |