Skip to content

Use parameter annotation for designating external events #1201

@alexander-yevsyukov

Description

@alexander-yevsyukov

Currently in order to react on an external event we need to set the external attribute of the React and Command annotations to true. Although it works, it's a bit confusing especially when it comes to commanding methods:

@Command(external = true)
RemoveTaskFromProject movingPolicy(TaskMoved event) {
    ...
}

It would be more natural if we annotate the parameter instead:

@Command
RemoveTaskFromProject movingPolicy(@External TaskMoved event) {
    ...
}

Event though we can probably try to determine the external nature of the event by its class via analysing @BoundedContext annotations, we do want to have this fact declared directly in the code of the application. It would ease the analysis of context mapping.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions