Domain Project
The Shopfoo.Product project implements domain workflows using the V4 Program.
Here is a simplified view from the solution explorer:
π src/
βββπ Core/
β βββποΈ Shopfoo.Common
β βββποΈ Shopfoo.Domain.Types
β βββποΈ Shopfoo.Program
βββπ Feat/
β βββποΈ Shopfoo.Home
β βββποΈ Shopfoo.Product ππ
β βββπ Model/
β β βββπ Product.fs π Validation logic
β β βββπ Prices.fs
β β βββπ Stock.fs
β βββπ Workflows/
β β βββπ Prelude.fs π Instructions + helpers
β β βββπ AddProduct.fs
β β βββπ DetermineStock.fs
β β βββπ MarkAsSoldOut.fs
β β βββπ RemoveListPrice.fs
β β βββπ SavePrices.fs
β β βββπ SaveProduct.fs
β β βββπ ...
β βββπ Data/
β βββπ Api.fs
β βββπ DependencyInjection.fs
β βββπ Manifest.fs
βββπ UI/
βββποΈ Shopfoo.Client
βββποΈ Shopfoo.Server
βββποΈ Shopfoo.SharedWe will examine each part separately:
Domain Model explains how the domain model is split between shared types (
Domain.Types) and aggregates (Model/) following DDD principles.Instructions describes how the instruction interface is defined, along with the ergonomic helpers for composing programs.
Workflows presents how to write domain workflows by analyzing typical use cases, including parallel execution and workflow cancellation with undo (saga pattern).
Data indicates a way to organize the data access layer, whether it is to access a database or call an external API.
Api describes how to define the project entry point, wire instructions to the data layer with undo strategies, and run workflows through the saga runner.
Last updated