Annotation Type Command


  • @Documented
    @Retention(RUNTIME)
    @Target(TYPE)
    public @interface Command
    Identifies a command in the context of CQRS, i.e. a request to the system for the change of data. Commands are always in imperative tense and thus, unlike an event, do not state that something has already happened, but something is requested to happen. With that, the CommandHandler which is processing the command has the option reject the command.
    Since:
    1.1
    See Also:
    CQRS Documents by Greg Young - Commands
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String name
      An identifier for the name of the command used to abstract away from the type system and to guard against refactorings.
      java.lang.String namespace
      An identifier for the namespace of the command to group multiple commands and let clients express their interest in all commands of a specific namespace.
    • Element Detail

      • namespace

        java.lang.String namespace
        An identifier for the namespace of the command to group multiple commands and let clients express their interest in all commands of a specific namespace. If not set, external tooling may default this to the fully-qualified package name of the annotated type.
        Default:
        ""
      • name

        java.lang.String name
        An identifier for the name of the command used to abstract away from the type system and to guard against refactorings. If not set, external tooling may default this to the simple class name of the annotated type.
        Default:
        ""