Giter Club home page Giter Club logo

Comments (6)

prolic avatar prolic commented on May 25, 2024

@codeliner from your code example, I can't know which interface is implemented on which connection implementation here.

About PublishingConnection - I don't think it's a good idea to have an event store connection being responsible to publish events on the message bus.

The setup looks strange, what if I change the order, f.e. inject UpcastingConnection into SnapshotConnection instead the other way around? Will it break?

I think from an end user perspective it looks much easier to setup like this:

$repository = new AggregateRepository($connection, $upcaster, $snapshotter, $publisher);

or maybe this:

$plugins[] = $upcaster;
$plugins[] = $snapshotter;
$plugins[] = $publisher;
$repository = new AggregateRepository($connection, $plugins);

from event-store-client.

codeliner avatar codeliner commented on May 25, 2024

@prolic it is always the same interface. The real connection gets decorated by connection implementations that implement the same interface, add their specific functionality and then call the parent method.

You can of course change the order. It's like a middleware pipe.

But ok, if you don't like it we need to find another way. The thing is moving upcasters and metadata enricher to the aggregate repository is wrong IMHO. You would need to pass the same plugins to each repository and prooph/event-sourcing is not always used. It is a separate package. micro for example don't use it. So we would need to create another plugin system for micro :(

from event-store-client.

prolic avatar prolic commented on May 25, 2024

from event-store-client.

codeliner avatar codeliner commented on May 25, 2024

micro was just an example. Good that most parts are covered but does not change the main issue that the aggregate repository is not responsible for a full blown plugin system. the event store is the central component and should provide the hooks. SnapshotStore is the only exception because it provides aggregate snapshots. Upcaster, MetadataEnricher, Publisher all deal with the events written to or read from the event store no matter where they come from.

That was the original idea of the plugin system. Not a fan of changing this. Why can't the event-store-client have a plugin system?

from event-store-client.

prolic avatar prolic commented on May 25, 2024

So maybe wrap the event store with "something" that has plugins? Like the ActionEventEmitterEventStore wrapper from v7

from event-store-client.

codeliner avatar codeliner commented on May 25, 2024

yeah, that sounds good 👍

from event-store-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.