Capstone requirements and boundaries
Capstone requirements and boundaries
Start an enterprise capstone with measurable requirements, ownership boundaries and explicit non-goals, before choosing libraries.
Build Stockroom, a fictional inventory and fulfillment system. A public catalog lists immutable product descriptions; a clerk reserves stock for their own tenant; a manager can see stock and process fulfillment for their tenant only. The lab uses two synthetic tenants and one SKU. A reservation is a positive quantity (1–10), identified by a tenant-scoped request key. It must not drive stock below zero. A repeated key with identical quantity returns the original outcome; a changed quantity returns conflict. A committed reservation creates exactly one outbox row in the same local transaction. Fulfillment processes pending rows transactionally, at most once as a local database effect. No payment, personal data, production identity, real delivery or external broker. The public catalog cache contains no availability or tenant information; availability is authoritative only in the database. English-only UI deliberately follows the requested locale. The solution uses a modular monolith, with typed contracts in Core, API and worker in Web, and independent acceptance harness in Checks. Modules are logical boundaries, not claims of independent deployability. A selective distributed alternative keeps inventory and reservation transaction together, sends outbox messages to fulfillment, and deduplicates messages at the consumer; transport remains at least once. Prefer the smaller architecture until a measured scaling or ownership problem justifies separation. A decision record must include context, alternatives, consequences and a trigger for revisiting. See lab-fixtures/capstone-v31 for the requirements trace, data-flow diagram, threat model, starter exercises and solution.
Baseline: .NET 10 / C# 14. All C# results below are reasoned, not executed. The capstone examples are synthetic; the separate solution is staged and unexecuted.
Translate a requirement into an invariant
A reservation is accepted only when quantity is in range and stock suffices.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;static bool CanReserve(int stock, int quantity) => quantity is >= 1 and <= 10 && stock >= quantity;foreach (var q in new[] {0, 3, 6, 11}) Console.WriteLine($"{q}: {CanReserve(5,q)}");Expected result (not executed):
0: False3: True6: False11: FalseThis pure check describes behavior, not concurrency protection. The solution enforces availability with an atomic conditional database update.
Scope request identities to their owner
The same request key may be used independently by two tenants.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;using System.Collections.Generic;var requests = new Dictionary<(string Tenant,string Key),int>();foreach (var row in new[] {("alpha","r1",2),("beta","r1",3),("alpha","r1",2),("alpha","r1",4)}) { var k=(row.Item1,row.Item2); if (requests.TryGetValue(k,out int old)) Console.WriteLine(old==row.Item3?"replay":"conflict"); else {requests.Add(k,row.Item3); Console.WriteLine("new");}}Expected result (not executed):
newnewreplayconflictThe tenant is part of the idempotency scope. Real authorization must derive it from a validated principal, not an arbitrary request body.
Choose an architecture using evidence
This classroom rule requires a measured bottleneck and an owner before proposing independent deployment.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;static string Decide(bool measured, bool independentOwner) => measured && independentOwner ? "evaluate split" : "keep modules";Console.WriteLine(Decide(false,true));Console.WriteLine(Decide(true,false));Console.WriteLine(Decide(true,true));Expected result (not executed):
keep moduleskeep modulesevaluate splitA split is still subject to consistency, operational and cost review. This rule is a teaching model, not an architecture certification.
Apply the concept
Write acceptance criteria for a second SKU and a tenant manager who cannot access other tenants. Add two non-goals.
Use the manual practice and knowledge check. Do not deploy or publish these fixtures.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Capstone requirements and boundaries — knowledge check
Apply the lesson concepts to the following scenarios.
Where is authoritative stock kept?
What belongs in a replay comparison?
Which boundary should stay atomic in the first version?
When should a service split be evaluated?
How should a non-goal be treated?