Saga Templates

33 views
Skip to first unread message

Koen Verwimp

unread,
May 22, 2018, 10:43:32 AM5/22/18
to Axon Framework Users
Hello,

Sometimes we have SAGAs that are used for a similar problem, but with other types of events.
He would be great, instead of copying the same code in a new Saga type, that we instantiate the saga with different "parameters".... like generic classes -> new XXXSaga<X,Y,Z>() ... .

Does Axon provide something like this?

Kind regards,
Koen

milan...@axoniq.io

unread,
May 25, 2018, 3:49:20 AM5/25/18
to Axon Framework Users
Hi Koen,

I am not aware of axon feature that does that. However, what you could do is to, instead of copying logic, is to extract the same logic into a separate (abstract) class and use inheritance / composition with 'real' sagas. That way, specific saga will react on its own events and it will reuse the extracted logic.

Hope this helps a bit!

Cheers,
Milan.

Koen Verwimp

unread,
May 29, 2018, 5:05:24 AM5/29/18
to Axon Framework Users
 I think i can solve this with inheritance. Thanks for your input!

Op vrijdag 25 mei 2018 09:49:20 UTC+2 schreef milan...@axoniq.io:
Reply all
Reply to author
Forward
0 new messages