docs
Systems
Messaging
CommandSystem
Public API Reference

Command

public sealed class Command : Message, ICommand

Generic, data-driven command envelope replacing feature-specific command classes. Implements ICommand and inherits from Message.

public int Verb { get; }

The domain-specific verb describing what the command asks for (e.g., (int)UICommandVerb.Open). Defined as a property with no setter; the verb is fixed when the command is created.

public static Command Create(Domain targetDomain, int verb)

Creates a command for the given domain and verb. The only public way to instantiate a command.

  • targetDomain: The Domain of the system the command is sent to.
  • verb: What the command asks for, as a domain-specific verb (cast from the domain's verb enum).
  • Returns: A new Command instance ready to have parameters added via Params.Set.

ICommand

public interface ICommand

Contract for commands: messages that tell the system owning a Domain to do something.

Domain TargetDomain { get; }

The Domain of the system this command is addressed to. Used by the CommandBus to route it.

int Verb { get; }

What the command asks for, as a domain-specific verb (e.g., (int)UICommandVerb.Open). The receiving system uses it to decide which action to perform.

Params Params { get; }

The data for the requested action, stored as typed params. Always present and empty until the sender adds values after creating the command.


IFlowControllable

public interface IFlowControllable

Contract for components that register with a domain's flow controller (e.g., UIFlowController) under a unique key, so the flow controller can find them.

string RegistrationKey { get; }

Unique key this component is registered and looked up under.

void Register()

Registers this component with its flow controller under its RegistrationKey.


ICommandProcessor

public interface ICommandProcessor

Contract for registered components that handle commands passed on by their flow controller. The flow controller receives the command from the CommandBus, then calls ProcessCommand on the component registered under the command's key parameter.

void ProcessCommand(ICommand cmd)

Handles a command passed on by the flow controller.

  • cmd: The command to process.