reference-guide
reference-guide copied to clipboard
Document limitations of Constructor Command Handler
The Constructor Command Handler has a number of limitations compared to regular Command Handler (instance) methods. These should be documented explicitly in the reference guide:
[ ] @ExceptionHandler
annotated methods aren't invoked - since there is no instance to invoke a method on
[ ] @HandlerInterceptor
annotated methods aren't invoked - since there is no instance to invoke a method on
[ ] AggregateLifecycle.apply()
invocations will not result in an immediate invocation of the @EventSourcingHandler
. Instead, the @EventSourcingHandler
methods are invoked once the constructor completes.
Also, we should (gently) promote the use of instance method with @CreationPolicy(ALWAYS)
as an alternative to Constructor Command Handlers.