Alternative names for @EventHandler

In the JTeam workshop yesterday, we encountered some confusion around
the purpose of the @EventHandler annotation in an aggregate.

The goal of the @EventHandler annotation is to mark methods that
change the state of the aggregate based on some event. This is not
clear from the name. Emphasis should IMHO be on 'state' not on

Here are some alternatives:
StateApplier, EventToStateHandler, EventToStateApplier, StateChanger

'Applier' corresponds nicely with the 'apply' method.

What do you think?

There are many types of events.

Whilst your suggestion applies to DomainEvent, it doesn’t apply with
the other two type of events.

Edward Yakop

Indeed, I was only talking about subclasses of AbstractAnnotatedAggregateRoot and DomainEvent.


Op 19-11-10 10:34, Edward Yakop schreef:

Does the annotation need to be a noun?

Often annotations for methods describe a situation or condition:


I would expect the annotation @EventHandler to annotate the class that
handles events not the methods. Like @Controller annotates the
controller and @RequestMapping the condition of the controller or
method to be called.