Let's say I have a task management application that uses the CQRS paradigm. How would I apply it to the following:
Scenario: As a user I want to create a task.
Java Pseudo Code:
interface Command {}
class CreateTaskCommand implements Command {
public String taskId;
public String description;
public boolean complete;
}
interface CommandHandler<Command> {
public void execute(Command command);
}
class CreateTaskHandler implements CommandHandler<CreateTaskCommand> {
public void execute(CreateTaskCommand cmd) {
validateTask(cmd);
repository.storeTask(new Task(cmd.taskId, cmd.description, cmd.complete));
}
}
Given the above code, where does the Event, EventHandler and Aggregate Root come into play (how would I proceed for the given story)?
Thanks for your help.