-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| COPY src/*/*.csproj ./ | |
| RUN for file in $(ls *.csproj); do mkdir -p ${file%.*}/ && mv $file ${file%.*}/; done |
A Git alias to quickly check out a Pull Request branch in a single move. ⚡
git config --global alias.cpr '!f() { git fetch --quiet ${GIT_DEFAULT_REMOTE-origin} pull/$1/head:pulls/$1 && git checkout pulls/$1; }; f'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Runtime.CompilerServices; | |
| public class C { | |
| async async await(await async) => await async; | |
| } | |
| [AsyncMethodBuilder(typeof(builder))] | |
| class async { | |
| public awaiter GetAwaiter() => throw null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ========= Event Sourcing in a nutshell | |
| (* | |
| FriendlyName: string | |
| Aggregate friendly name. | |
| Initial: 'State | |
| Initial (empty) state we will start with. | |
| Decide: 'Command -> 'State -> 'Event list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. pure, don't think about IO at all | |
| module Domain = | |
| let add x y = x + y | |
| // 2. think about IO but not its implementation | |
| module App = | |
| let add (getX: unit -> Async<int32>) y = | |
| async { | |
| let! x = getX () | |
| return Domain.add x y |
OlderNewer