You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My doubt is: do we really want OnDSL for custom strategies? That is a fine default but once you diverge from default, I have a feeling you don't need that on handlers because you have your own event->method dispatch.
- default strategy extends class with OnDSL
- with custom strategy you likely don't want any of the DSLs
- custom strategy which is just DefaultApplyStrategy.new(strict: true)
and wants `on_methods` needs following:
class MyAggregate
include AggregateRoot.with_strategy(->{ DefaultApplyStrategy.new(strict: false) })
extend AggregateRoot::OnDSL
end
[#678, #679]
When you use
include AggregateRoot.with_strategy(strategy)
you're gettingwhen applying facts because
OnDSL
module is not included - it's included only when you're using default strategy (withinclude AggregateRoot
).It turned out that for custom strategy we're extending a module with
Constructor
module while with default strategy there'sextend OnDSL
.The text was updated successfully, but these errors were encountered: