EventFlow icon indicating copy to clipboard operation
EventFlow copied to clipboard

Aggregate independent commands

Open ghost opened this issue 7 years ago • 8 comments

Hi there,

is it possible to send and handle commands that are not related to a aggregate?

As ICommand<Aggregate, …> and ICommandHandler<Aggregate, …> both require aggregate types, it seems impossible.

Sincerely,

Nolde

ghost avatar May 11 '18 13:05 ghost

Commands are currently only for aggregates in EventFlow. If you want to use commands for something else you could take a look at https://github.com/BrighterCommand/Brighter (i haven't used it myself though).

rasmus avatar May 12 '18 17:05 rasmus

Thanks a lot for your quick reply.

In general i'm happy with aggregate bound commands.

But aside of those, i have to deal with some work that does not refer to aggregates. So I am looking for a solution based on event flow, as this is the framework of my choice and i do not want to have a second command execution framework in my application.

Maybe there's an implementation scenario for such a requirement that brings additional value for your framework.

Sincerely,

Nolde

ghost avatar May 14 '18 17:05 ghost

That's maybe related to issue https://github.com/eventflow/EventFlow/issues/181

ghost avatar May 15 '18 17:05 ghost

I would make sense to loosen up the restrictions a bit. I do try make sure that EventFlow doesn't impose too many limits on how you would like to implement your domain.

rasmus avatar May 16 '18 19:05 rasmus

We have a maybe a another use case in combination with sagas.

Right now we sometimes use direct updates on the sagas using the new method you expose on the sagastore. However these are all use cases in which we would rather send a command to the Saga in the same way as we send them to Aggregates.

wgtmpeters avatar May 16 '18 20:05 wgtmpeters

So basically there would be three different cases the command bus would handle

  1. Commands for aggregates (find handler, pass aggregate via the update on aggregate store)
  2. Commands for sagas (find handler, pass saga via the update on saga store)
  3. Commands for everything else (find handler, execute)

rasmus avatar May 18 '18 17:05 rasmus

For the important part is that a clear implementation can be found, one that doesn't have to "forced" into the code base.

rasmus avatar May 18 '18 17:05 rasmus

These 3 types of commands are exactly what I need. Thank you, I appreciate your efforts.

ghost avatar May 18 '18 17:05 ghost

Hello there!

We hope you are doing well. We noticed that this issue has not seen any activity in the past 90 days. We consider this issue to be stale and will be closing it within the next seven days.

If you still require assistance with this issue, please feel free to reopen it or create a new issue.

Thank you for your understanding and cooperation.

Best regards, EventFlow

github-actions[bot] avatar Apr 08 '23 13:04 github-actions[bot]

Hello there!

This issue has been closed due to inactivity for seven days. If you believe this issue still needs attention, please feel free to open a new issue or comment on this one to request its reopening.

Thank you for your contribution to this repository.

Best regards, EventFlow

github-actions[bot] avatar Apr 16 '23 09:04 github-actions[bot]