# 5-B.3 Create Component Diagram

The container diagram is a even further "zoomed-in" version of the [5-B.2 Create Container Diagram](/implementation-playbook/1.0.1/implementation/design-architecture/5-b.2-create-container-diagram.md#container-diagram) and shows the software architecture within a single container. You dont have to create this diagram for every container, usually it is done for containers that need to be custom-coded. This most prominently includes the frontend and backend containers as well as special components, like a batch component or an complicated adapter. A bounded context might also be implemented as its own component, if it isn't big enough to justify its own container.

Example Component Diagram:

<figure><img src="/files/sO4hUoQWYImD06UlKKKM" alt=""><figcaption><p>Adapted from https://c4model.com (CC BY 4.0). Changes made.</p></figcaption></figure>

Example Template:

<figure><img src="/files/KvhHg2HkeXYW8uVSI34Z" alt=""><figcaption></figcaption></figure>

## Design Principles

* Modularity
  * Expanding on the ideas presented in [5-B.2 Create Container Diagram](/implementation-playbook/1.0.1/implementation/design-architecture/5-b.2-create-container-diagram.md#modular-design), a modular approach is also recommended within a container
  * Try to identify components and especially business components / domain components that encapsulate a specific area of concern
    * the data model is usually a good starting point informing you of areas of high cohesion
* Some commonly used design patterns for dealing with external systems include Adapter, Proxy & Facade (see [Software design pattern - Wikipedia](https://en.wikipedia.org/wiki/Software_design_pattern)).\ <br>

  <figure><img src="/files/vJmU0QQS10D34vEzpfmS" alt="" width="375"><figcaption><p>Adapted from a CC0 1.0 public-domain diagram (Wikimedia Commons). Changes were made.</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://specs.govstack.global/implementation-playbook/1.0.1/implementation/design-architecture/5-b.3-create-component-diagram.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
