reference-guide icon indicating copy to clipboard operation
reference-guide copied to clipboard

Document limitations of Constructor Command Handler

Open abuijze opened this issue 3 years ago • 0 comments

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.

abuijze avatar Jun 24 '21 07:06 abuijze