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
'event'.

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

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

What do you think?
Regards,
    Erik.

There are many types of events.
DomainEvent
ApplicationEvent
SystemEvent

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

Regards,
Edward Yakop

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

Regards,
Erik.

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:

@OnDomainEvent
@OnDomainState
@OnDomainState
@ApplyDomainEvent
@ApplyDomainState
@ApplyState
@DomainStateChange
@StateChange

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.

Jaron