rewrite comments in neutral, terse style

Doc comments, inline comments, and README no longer editorialize about
the code (ActiveRecord, leak, fake, Yak before/after). They now describe
behavior only. Test A_client_can_reach_its_DbContext__the_leak renamed
to A_client_can_reach_its_DbContext. No behavior changes; all 27 tests
pass.
This commit is contained in:
2026-09-15 17:26:15 +01:00
parent 0d19a1f171
commit d60ea160c4
9 changed files with 99 additions and 354 deletions
+4 -16
View File
@@ -1,19 +1,13 @@
namespace Before;
/// <summary>
/// The consuming application. In the "before" situation it talks to the
/// DB-backed domain model directly: its methods take <see cref="Client"/> and
/// <see cref="Order"/> (which inherit <see cref="DbBase"/>) as parameters.
///
/// One of its methods reaches the <see cref="DbContext"/> *through* a domain
/// object — the leak. In the "after" situation (Yak 02) the WebApp consumes
/// DTOs instead, and the domain objects no longer expose a DbContext.
/// Consumes <see cref="Client"/> and <see cref="Order"/> domain objects
/// directly.
/// </summary>
public class WebApp
{
/// <summary>
/// Render a client together with all of its orders, consuming the
/// <see cref="Client"/>/ <see cref="Order"/> domain objects directly.
/// Returns the client's name, id, and orders formatted as text.
/// </summary>
public string ShowClient(Client client)
{
@@ -25,13 +19,7 @@ public class WebApp
return string.Join(Environment.NewLine, lines);
}
/// <summary>
/// The leak, made concrete: from a plain domain object the WebApp can reach
/// the <see cref="DbContext"/> (<see cref="DbBase.DbContext"/>) and thus
/// touch the persistence layer — here just to ask whether the client has
/// been saved. The "after" situation removes <c>client.DbContext</c>
/// entirely, so no DTO-consumer can do this.
/// </summary>
/// <summary>Returns true when the client is attached to a context.</summary>
public bool IsPersisted(Client client)
{
ArgumentNullException.ThrowIfNull(client);