CHACK: A Simple Way to Structure Software Applications
TL;DR
CHACK is a simple structural model for a single app. Every piece of code you write belongs to exactly one of four categories:
- Core
- Humble Objects at the process boundary
- Automated Tests
- Composition Root
And the K? That's me, Kenny. It also lets you say CHACK just like "Chuck".

CHACK Overview
All four categories may depend on the frameworks and libraries. Those arrows are left out to keep the number of arrows manageable.
- The Core is everything that runs in memory: your domain model, your services, your DTOs, your validators. It holds the logic that makes the software worth building, and it never performs an I/O call itself. When it needs one, it goes through an abstraction that belongs to the Core.
- Humble Objects sit at the process boundary and do the I/O. Each one does two things: perform the actual I/O call to a third-party system, and map the data going out and coming back. They follow the Humble Object pattern from Gerard Meszaros' xUnit Test Patterns.
- Automated Tests follow the test pyramid. Unit tests exercise the Core with humble objects replaced by in-memory test doubles, which is why thousands of them run in seconds. Integration and end-to-end tests cover the happy path and wiring against third-party systems and act as a second line of defense against regression.
- The Composition Root assembles the pieces at startup - usually with a DI container and configuration from files, environment variables, and command line parameters. It is described in depth in Mark Seemann's and Steven van Deursen's Dependency Injection Principles, Practices, and Patterns.
Most arrows in the diagram are compile-time dependencies, like in UML:
- an open arrowhead means one category references another
- a dashed line with a hollow triangle means one type implements or derives from another
The Composition Root knows the Core; the Core does not know the Composition Root. Humble Objects and Test Doubles implement the I/O abstractions. The abstractions themselves belong to the Core according to the Dependency Inversion Principle, which is why both boxes carry the brand gradient. The one double-headed arrow on the left represents I/O calls happening at runtime.
The placements along the process boundary are deliberate. The Humble Objects box sits on the boundary, because they make outgoing calls or receive incoming ones. Integration tests straddle the boundary: they may exercise the system under test inside or outside the test runner process. End-to-end tests sit outside, to the right of the boundary, because they usually start the system under test in another process (e.g., via Docker Compose). Unit tests and their test doubles stay inside the test runner process. Every category may also use the frameworks and libraries it references, so those arrows are left out to keep the picture readable.
All of this can happen in a single project, and CHACK encourages you to keep the number of projects in your codebase small.
The problem CHACK solves
Codebases become difficult to maintain at either of two design extremes.
Too Little Abstraction
- Thousands of lines of code in a single file
- Little or no abstraction: SQL statements, HTTP calls, business logic, UI manipulation all reside in the same scope
- Tight coupling makes individual parts impossible to test automatically without third-party systems
Excessive Abstraction
- Loose coupling everywhere: new functionality → new class, new interface, an army of interfaces and tiny objects
- Many test doubles scatter the test suite
- Static methods are considered tight-coupling and are forbidden
- You have to jump to the definition ten times to find the code that actually does the work
At one extreme, too little abstraction produces "Spaghetti Code". Too many responsibilities accumulate in a single type: business rules become tangled with calls to third-party systems (e.g., with SQL statements and HTTP calls), files grow to thousands of lines, and even simple tests require a database. Every change becomes risky because parts of the code cannot be tested in isolation - the result is a fragile codebase.
Excessive abstraction sits at the opposite extreme. Applying principles like SOLID and design patterns mechanically produces a maze of interfaces, tiny classes, and layers of indirection. The code may be loosely coupled, yet understanding a single domain behaviour requires tracing it across half a dozen abstractions.
CHACK avoids both extremes by being deliberate about where abstraction adds value:
- Abstract I/O at the process boundary. For each third-party system used in a given context, define a Core-owned abstraction and implement it with a Humble Object. Tests can replace the Humble Object with a test double, allowing the Core logic to run entirely in memory.
- Use abstractions selectively inside the Core. Core types are tightly coupled by default. Introduce an interface or abstract base class only when it serves a concrete purpose - multiple meaningful implementations are often a good indication. An endpoint service, for example, may call its validator directly; one unit test can cover both without a test double.
You want to use the Mediator pattern in your codebase? Go ahead. CQRS, event sourcing, a rich domain model, an anemic one? All compatible with CHACK.
CHACK forces you to make a clear distinction between in-memory and I/O calls. Make the blue Core box as large as possible to have more code that in-memory Unit Tests can target. It does not tell you how to design within the four categories.
A methodology, not a framework
There is nothing to install. CHACK is a way of introducing the right seams in your codebase. It works the same in an ASP.NET Core service, an Angular app, a WPF app, or a console tool. If you can answer "Which of the four categories does this piece of code exclusively belong to?", you are doing it.
Because most of my work is in .NET, the concrete examples are C#. To keep the model itself language-neutral, these docs come in two parts:
- The methodology - the pages in the main section. They hold for any language and any framework.
- CHACK in .NET - a section of its own that shows how the model looks in the stack I use every day: ASP.NET Core, Entity Framework Core, and the .NET base class library.
Each methodology page ends with a callout like the one below, which takes you to its .NET counterpart:
CHACK in .NET gives you an overview of the .NET pages, the libraries that help, and a reference implementation.
If you work in another ecosystem, you can skip these callouts. Nothing in CHACK depends on them.
Why CHACK?
You might be wondering why you should care about CHACK. There are already many approaches to designing software, like Hexagonal Architecture, Domain-Driven Design, or Clean Architecture. CHACK doesn't bring particularly new things to the table. It is rather a distillation of patterns and approaches which can be easily taught to new developers and applied.
Consider how many books you need to read to understand and apply Hexagonal Architecture, or Clean Architecture? I think CHACK is so condensed that it can be easily taught in 4 to 8 hours. You can start applying it without use of any frameworks or project templates. Apply it to parts of your codebase and see the benefits. Start small and grow over time.
Where to go next
- Read the four categories in order: The Core, Humble Objects, Automated Tests, and The Composition Root.
- Want to see how Humble Objects deal with transactions? Clients and Sessions shows both kinds and why CHACK avoids Repositories.
- Want to see a complete feature? Building Blocks of a Backend Feature walks through one, from the domain model to the Unit Tests.
- Wondering how to organize your code? Vertical Slices is the structure CHACK prefers.
- Reviewing a codebase? Reviewing for CHACK is the checklist I use.
- Wondering how this relates to Hexagonal Architecture, Clean Architecture, or DDD? See Relationship to Other Approaches.
- Working in .NET? CHACK in .NET shows all of this in C#.
Sources
CHACK stands mainly on four books:
- Eric Evans, Domain-Driven Design - the Ubiquitous Language, the isolated Domain (Core) and the patterns that shape the Core: Entities, Value Objects, and Aggregates.
- Martin Fowler et al., Patterns of Enterprise Application Architecture - the catalogue for Line-of-Business software: domain models, O/R mapping, units of work, data transfer objects, among other patterns.
- Steven van Deursen and Mark Seemann, Dependency Injection Principles, Practices, and Patterns - the Composition Root and its Register-Resolve-Release phases.
- Gerard Meszaros, xUnit Test Patterns - the Humble Object pattern, the four-phase test, and the vocabulary for test doubles.
Robert C. Martin's Clean Architecture is worth adding: chapter 23 describes humble objects at the process boundary and arrives at much the same place from a different direction. For organizing code around features, CHACK borrows from Jimmy Bogard's Vertical Slice Architecture.