prooph

How can i avoid using prooph's event sourcing?


Concept of Event Sourcing in my mind is that Event Sourcing is related to Domain layer which can't be coupled with Infrastructure layer. so I will not use prooph/event-sourcing component and this is why Prooph's team will not maintain event-sourcing component. (this article metioned)

Question is coming, Aggregate, DomainEvent and so on is belong to Domain layer, they are put in event-sourcing component. Event store is belong to Infrastructure layer, so i can use prooph/event-store component directly. However, I found class Prooph\EventSourcing\Aggregate\AggregateRepository is used in prooph/event-store-symfony-bundle, why does AggregateRepository is put in event sourcing? I consider Repository to Infrastructure conecrning, event store symfony bundle shouldn't use event sourcing component any more and Repository also shouldn't be put in event sourcing.

That's confusing me. so I can't use prooph/event-store now.

How do you think?


Solution

  • A repository is the link between the domain model and infrastructure. It's put into the event sourcing component because the event store does not care about aggregates and how they are organized at all. The event store manages streams of events. Only the repository puts that into shape. It uses the event stream capabilities of the even store to manage event history of aggregates. Hence, the repository is also your responsibility. You're right that a new version of the symfony bundle should no longer include a repository implementation but only provide prooph/event-store. That's not done yet. In fact, prooph/event-sourcing is maintained until end of 2019 so we are not in a hurry.

    Anyway, I highly recommend to take a look at Event Machine. At the moment it is based on prooph/event-sourcing, service-bus and event-store, but already provides an abstraction layer and a way to fully decouple the domain model and other parts of your system from prooph and Event Machine itself. Just do the tutorial to learn more about it (takes 4-6 hours).