jorge07 / symfony-6-es-cqrs-boilerplate

Symfony 6 DDD ES CQRS backend boilerplate.
MIT License
1.07k stars 187 forks source link

Command Handler: persisting data #125

Closed marcopicasso closed 5 years ago

marcopicasso commented 5 years ago

How are data persisted in write database from command handler ?i'm a beginner with es-cqrs and it's difficult for me to understand this step!

Lutacon commented 5 years ago

The projectors are listening on events of the EventBus so when an event is published, it reacts to the events and store it in the write side.

It's better explained here

marcopicasso commented 5 years ago

So, if i understand, the UserEmailReadProjectionFactory class is used to persist data on the db, right?

jorge07 commented 5 years ago

Right. It's a listener that will receive the events after they are persisted so you can do whatever you want with them.

marcopicasso commented 5 years ago

Read class to Write data....it confuses me a little!

jorge07 commented 5 years ago

Ops Typo