Components & code

Most C4 models stop at the container level, and that's correct. This page covers the two deeper levels for the few places that earn them.

Components: the inside of one container

A Component is a structural building block inside a single container — a service, a module, an adapter. A component layer answers "how is this one part organized?" for the people who work on it.

Step 1 — Set a zoom target

In the editor, give the container a zoom target layer, exactly as you did for the system in Containers & drill-down.

Step 2 — Add component elements

On that layer, add Component elements for the major groupings — not every class.

Step 3 — Connect them

Connect them with labeled relationships as usual.

Only one container's internals per layer. Two containers' components on one canvas is the same level-mixing mistake as putting components on the container diagram.

When a container earns it

Draw a component layer when:

  • several people need to agree on the container's internal structure;
  • the container is the system's risk concentration (the "everything goes through it" part);
  • onboarding to that container keeps requiring a whiteboard session.

Skip it when the container is a database, a third-party product, or anything whose insides nobody needs to discuss.

Code: the level you don't draw

The code level (classes, sequences) changes with every commit. Hand-drawn, it's stale before the ink dries. Model code-level elements only where a specific structure genuinely needs to be communicated and is stable enough to stay true.

Where next