public void changeTitle(String title) { applyEvent(new NoteTitleChanged(title)); }
public void handle(ICommandContext context, CreateNoteCommand command) { context.add(new Note(command.getAggregateRootId(), command.getTitle())); } }
public void handle(ICommandContext context, ChangeNoteTitleCommand command) { context.get(Note.class, command.getAggregateRootId()).changeTitle(command.getTitle()); } }
public Note(String id, String title) { super(id); applyEvent(new NoteCreated(title)); }