Awesome
What is this?
The code here is a fork of J�r�mie Chassaing's FsUno.Prod Functional Event Sourcing sample.
NB be sure to read the FsUno.Prod Journey.
Why ?
Most importantly, it contains NEventStore v5 integration with the aim of integrating that via a PR against FsUno.Prod
As part of this, the Command Handler and other aspects have been revised to be able to work consistenly across both GES and NES (and assumes stores to be async
).
NB THIS IS ONLY A FORK - while most ideas will hopefully make it in (as issues/PRs) into FsUno.Prod
, the aim continues to be to have the actual showcase be FsUno.Prod
Building
Run ./build.cmd
to verify clean build and/or restore packages
Feature Notes vs FsUno.Prod
- Supports 2 store types (NES, GES)
- Demonstrates event type naming encoding scheme
- Demonstrates selective projection scheme (all but neutral to whether one is using NES or GES)
- Separates Event Encoding from Serialization
- Separates Serialization from Event Storage
- Does not rely on
empty
State elements orinitial
method on State -state
arguments supplied tohandle
andevolve
areoption
s
Major TODOs
- Further pursuit of generalized Command Processing strategies (outside of just rambling 'Acceptance Test' code) e.g. enriching commands etc.
- Further pursuit of generalized Projection Processing strategies inc e.g. awaiting in-memory projection completion
- Experiment more with the [unquote based] test DSLs and/or layer on some wrappers
- Expose access to store-specific headers etc.
Style notes vs FsUno.Prod
There are also some style variances from FsUno.Prod. In order of my desire to getting them embodied in the FsUno.Prod codebase:
Uno.fs
should not have any code - Builders are separated- I've 'already' renamed
apply
toevolve
(not yet agreed in FsUno.Prod) - No .Domain suffixes on assemblies or namespace
- I've used unquote for the tests to show an alternate (slightly quirky) DSL. The big advantage is that there's no other test infrastructure to write / copy between test suites
- I've pushed the Command messages out into the UL file too
- Does not rely on
empty
State elements orinitial
method on State -state
arguments supplied tohandle
andevolve
areoption
s
Open questions
- is
handle state command
(which I ended up using in this codebase by accident in the pursuit of brevity) more correct thanhandle command event
? (if it is, that's an FsUno.Prod issue; if not, more brackets in the test-DSL) - Is the [arguably positive] tension (one'll be forced to pull stuff out of the body if you want it to stay screen-sized) caused by having all command-handlers in a single pattern match vs having a handler mapping function a good tradeoff ?