Skip to content

Commit 3026732

Browse files
committed
Inline Backend project into Domain
1 parent c43c55d commit 3026732

38 files changed

+245
-304
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ The `Unreleased` section name is replaced by the expected version of next releas
3737
- `Equinox.Tool`: Target `FSharp.Core` v `4.7.1`
3838
- Update AzDO CI/CD to use `windows-latest`
3939
- Update to `3.1.101` SDK
40-
- Remove `module Commands` convention from in examples
40+
- Remove `module Commands` convention from examples
41+
- Remove separated `Backend` project from examples (support for architecturally separating all domain logic from Equinox and Domain Service logic from Concrete Stores remains)
4142
- Revise semantics of Cart Sample Command handling
4243
- Simplify `AsyncCacheCell` [#229](https://github.com/jet/equinox/pull/229)
4344

DOCUMENTATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ which can then summarize the overall transaction.
13071307
### Idiomatic approach - composed method based on side-effect free functions
13081308

13091309
There's an example of such a case in the
1310-
[Cart's Domain Service](https://github.com/jet/equinox/blob/master/samples/Store/Backend/Cart.fs#L53):
1310+
[Cart's Domain Service](https://github.com/jet/equinox/blob/master/samples/Store/Domain/Cart.fs#L128):
13111311

13121312
```fsharp
13131313
let interpretMany fold interpreters (state : 'state) : 'state * 'event list =
@@ -1334,7 +1334,7 @@ there's no need to read it as the preceding approach is the recommended one is
13341334
advised as a default strategy to use_
13351335

13361336
As illustrated in [Cart's Domain
1337-
Service](https://github.com/jet/equinox/blob/master/samples/Store/Backend/Cart.fs#L5),
1337+
Service](https://github.com/jet/equinox/blob/master/samples/Store/Domain/Cart.fs#L99),
13381338
an alternate approach is to encapsulate the folding (Equinox in V1 exposed an
13391339
interface that encouraged such patterns; this was removed in two steps, as code
13401340
written using the idiomatic approach is [intrinsically simpler, even if it

Equinox.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Domain", "samples\Store\Dom
2929
EndProject
3030
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Domain.Tests", "samples\Store\Domain.Tests\Domain.Tests.fsproj", "{406A280E-0708-4B12-8443-8FD5660CD271}"
3131
EndProject
32-
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Backend", "samples\Store\Backend\Backend.fsproj", "{0D98B603-2EBB-40C2-AFE5-083C92EFB822}"
33-
EndProject
3432
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Infrastructure", "samples\Infrastructure\Infrastructure.fsproj", "{ACE52D04-2FE3-4FD6-A066-9C81429C3997}"
3533
EndProject
3634
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Integration", "samples\Store\Integration\Integration.fsproj", "{0B2D5815-D6A5-4AAC-9B75-D57B165E2A92}"
@@ -108,10 +106,6 @@ Global
108106
{406A280E-0708-4B12-8443-8FD5660CD271}.Debug|Any CPU.Build.0 = Debug|Any CPU
109107
{406A280E-0708-4B12-8443-8FD5660CD271}.Release|Any CPU.ActiveCfg = Release|Any CPU
110108
{406A280E-0708-4B12-8443-8FD5660CD271}.Release|Any CPU.Build.0 = Release|Any CPU
111-
{0D98B603-2EBB-40C2-AFE5-083C92EFB822}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
112-
{0D98B603-2EBB-40C2-AFE5-083C92EFB822}.Debug|Any CPU.Build.0 = Debug|Any CPU
113-
{0D98B603-2EBB-40C2-AFE5-083C92EFB822}.Release|Any CPU.ActiveCfg = Release|Any CPU
114-
{0D98B603-2EBB-40C2-AFE5-083C92EFB822}.Release|Any CPU.Build.0 = Release|Any CPU
115109
{ACE52D04-2FE3-4FD6-A066-9C81429C3997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
116110
{ACE52D04-2FE3-4FD6-A066-9C81429C3997}.Debug|Any CPU.Build.0 = Debug|Any CPU
117111
{ACE52D04-2FE3-4FD6-A066-9C81429C3997}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -204,7 +198,6 @@ Global
204198
{D67D5A5F-2E59-4514-A997-FEBDC467AAF6} = {8F3EB30C-8BA3-4CC0-8361-0EA47C19ABB9}
205199
{37B4A45F-039E-4515-8A84-D242DDE12D22} = {D67D5A5F-2E59-4514-A997-FEBDC467AAF6}
206200
{406A280E-0708-4B12-8443-8FD5660CD271} = {D67D5A5F-2E59-4514-A997-FEBDC467AAF6}
207-
{0D98B603-2EBB-40C2-AFE5-083C92EFB822} = {D67D5A5F-2E59-4514-A997-FEBDC467AAF6}
208201
{ACE52D04-2FE3-4FD6-A066-9C81429C3997} = {8F3EB30C-8BA3-4CC0-8361-0EA47C19ABB9}
209202
{0B2D5815-D6A5-4AAC-9B75-D57B165E2A92} = {D67D5A5F-2E59-4514-A997-FEBDC467AAF6}
210203
{1B0D4568-96FD-4083-8520-CD537C0B2FF0} = {8F3EB30C-8BA3-4CC0-8361-0EA47C19ABB9}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ The main language in mind for consumption is of course F# - many would say that
662662

663663
## You say I can use volatile memory for integration tests, could this also be used for learning how to get started building event sourcing programs with equinox?
664664

665-
The `MemoryStore` backend is intended to implement the complete semantics of a durable store (aside from caching). The main benefit of using it is that any tests using it have zero environment dependencies. In some cases this can be very useful for demo apps or generators (rather than assuming a specific store at a specific endpoint and/or credentials, there is something to point at which does not require configuration or assumptions.). The single problem of course is that it's all in-process; the minute you stop the host, the items on your list will of course disappear. In general, EventStore is a very attractive option for prototyping; the open source edition is trivial to install and has a nice UI that lets you navigate events being produced etc.
665+
The `MemoryStore` is intended to implement the complete semantics of a durable store (aside from caching). The main benefit of using it is that any tests using it have zero environment dependencies. In some cases this can be very useful for demo apps or generators (rather than assuming a specific store at a specific endpoint and/or credentials, there is something to point at which does not require configuration or assumptions.). The single problem of course is that it's all in-process; the minute you stop the host, the items on your list will of course disappear. In general, EventStore is a very attractive option for prototyping; the open source edition is trivial to install and has a nice UI that lets you navigate events being produced etc.
666666

667667
### OK, so it supports CosmosDB, EventStoreDB and might even support more in the future. I really don't intend to shift datastores. Period. Why would I take on this complexity only to get the lowest common denominator ?
668668

samples/Infrastructure/Infrastructure.fsproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<ProjectReference Include="..\..\src\Equinox.CosmosStore\Equinox.CosmosStore.fsproj" />
2323
<ProjectReference Include="..\..\src\Equinox.EventStore\Equinox.EventStore.fsproj" />
2424
<ProjectReference Include="..\..\src\Equinox.MemoryStore\Equinox.MemoryStore.fsproj" />
25-
<ProjectReference Include="..\Store\Backend\Backend.fsproj" />
2625
<ProjectReference Include="..\Store\Domain\Domain.fsproj" />
2726
<ProjectReference Include="..\TodoBackend\TodoBackend.fsproj" />
2827
</ItemGroup>

samples/Infrastructure/Services.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ type ServiceBuilder(storageConfig, handlerLog) =
2929
member __.CreateFavoritesService() =
3030
let fold, initial = Favorites.Fold.fold, Favorites.Fold.initial
3131
let snapshot = Favorites.Fold.isOrigin,Favorites.Fold.snapshot
32-
Backend.Favorites.create handlerLog (resolver.Resolve(Favorites.Events.codec,fold,initial,snapshot))
32+
Favorites.create handlerLog (resolver.Resolve(Favorites.Events.codec,fold,initial,snapshot))
3333

3434
member __.CreateSaveForLaterService() =
3535
let fold, initial = SavedForLater.Fold.fold, SavedForLater.Fold.initial
3636
let snapshot = SavedForLater.Fold.isOrigin,SavedForLater.Fold.compact
37-
Backend.SavedForLater.create 50 handlerLog (resolver.Resolve(SavedForLater.Events.codec,fold,initial,snapshot))
37+
SavedForLater.create 50 handlerLog (resolver.Resolve(SavedForLater.Events.codec,fold,initial,snapshot))
3838

3939
member __.CreateTodosService() =
4040
let fold, initial = TodoBackend.Fold.fold, TodoBackend.Fold.initial

samples/Store/Backend/Backend.fsproj

Lines changed: 0 additions & 30 deletions
This file was deleted.

samples/Store/Backend/Cart.fs

Lines changed: 0 additions & 80 deletions
This file was deleted.

samples/Store/Backend/ContactPreferences.fs

Lines changed: 0 additions & 21 deletions
This file was deleted.

samples/Store/Backend/Favorites.fs

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)