Implementing an Event Store

Let’s now actually implement a few different Event Stores that are suitable for use with A+ES. The Stores here are simple and aren’t designed for extremely high performance, yet they will be good enough for most domains.

While the implementation for each of the various Event Stores is different, the contracts are the same:

public interface IEventStore {   // loads all events for a stream   EventStream LoadEventStream(IIdentity id);   // loads subset of events for a stream   EventStream LoadEventStream(     IIdentity id, int skipEvents, int maxCount);   // appends events to a stream, throwing   // OptimisticConcurrencyException another appended   // new events since expectedversion   void ...

Get Implementing Domain-Driven Design now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.