✨ ARCANUM RUNE DIFFICULTY: Apprentice Behavioral

The Command: Encapsulating the Will

Encapsulate a request as an object, thereby letting you parameterize clients with different requests.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Command
ARCANUM SCHOOL: Enchantment // Domination
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
public interface GNOMEArtifice.CyberCommand : Object {
    public abstract void execute();
}

public class GNOMEArtifice.DroneControl : Object {
    public void launch() { print("Drone swarm launching.\n"); }
    public void self_destruct() { print("Drone swarm initiating self-destruct sequence.\n"); }
}

public class GNOMEArtifice.LaunchCommand : Object, CyberCommand {
    private DroneControl control;
    public LaunchCommand(DroneControl control) { this.control = control; }
    public void execute() { this.control.launch(); }
}

public class GNOMEArtifice.DestructCommand : Object, CyberCommand {
    private DroneControl control;
    public DestructCommand(DroneControl control) { this.control = control; }
    public void execute() { this.control.self_destruct(); }
}

public class GNOMEArtifice.NeuralLink : Object {
    private CyberCommand cmd;
    public void set_command(CyberCommand cmd) { this.cmd = cmd; }
    public void trigger() { this.cmd.execute(); }
}

A Neural Link must remain agnostic to the specific destruction it wreaks. By utilizing the Command pattern, the intent of the user—be it launching a drone swarm or initiating a scorched-earth self-destruct—is crystallized into an object. The invocation trigger() simply releases the contained spell, allowing the GNOME Artifice to queue, delay, or log the deadly commands without entangling the triggering apparatus in the morbid details of the execution.

Runic Tags: #Vala #GObject #Behavioral #Command