Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This applies a set of code patterns that I've been applying in recent times in a system I'm building that consists of the following elements:
Domain
project defines amodule Config
which defines aStore
DU which defines the set of stores its connectable to. This would be Memory plus one or more concrete onesmodule Aggregate
has amodule Config
which surfaces acreate
method that is passed a Store DU instance and does the appropriate wiring (e.g. if using Cosmos and Snapshots makes sense, it means that logic is close to the aggregate)Equinox.CosmosStore
. NOTE there should be no logic in theDomain
project actually connecting to the store - this is purely to allow one to wire the specific ways the caching or snapshotting needs to work per aggregate in a single placeWhen Domain is organised in this manner, the following becomes clean to do:
a) define high level tests that operate in-memory which exercise significant workflows in a system (often cross-aggregate), using a Memory Store
b) define integration tests that use the concrete stores
c) define Web host and/or Reactor apps without repeating wiring logic (if it needs to be shared, a
.Infrastructure
project can have that specific wiring)A better demo app is needed, and will arrive in due course; for now, the closest thing is the layout of the
equinox-shipping
projectIncludes:
async
support