Skip to content

Model vs. View

An architecture has many parts and many readers. No single picture suits everyone. Two ideas help: the model and the view.

Model. The model is structured data about the architecture. It is not visual. It exists apart from any picture of it.

View. A view is a representation of one or more structural aspects of an architecture. It shows how the architecture addresses stakeholder concerns. A stakeholder is a person with an interest in the system (see the article Stakeholder). In C4 modeling tools, a diagram is a view created on top of the model. The tool renders the view as a diagram.

Several views, one model. You can build different views on the same model. Each view fits its readers. Kruchten’s 4+1 approach works this way. It has four views: logical, development, process and physical. Scenarios are the “plus one”. The views describe the system from the standpoint of different stakeholders, such as end users, developers, system engineers and project managers.

Viewpoint versus view. A viewpoint is a set of conventions for building one type of view. It covers patterns, templates and the stakeholders the view serves. The view is the instance made by following those conventions.

Tooling. The Structurizr DSL separates model content from view presentation. You describe the content once. You define the views separately.

A standard view. The arc42 building block view shows the static decomposition of the system into building blocks. Architecture documentation must include it.

A team describes an online shop. The model lists the web shop, the payment service and the order database, and how they connect. One view shows only the web shop and its neighbors, for business readers. Another view shows the internal blocks, for developers. Both views draw on the same model.

The facts here do not cover costs or drawbacks of separating model from views.

One model, several views for different stakeholders.

Diagram source
flowchart TD
M[Model: elements and relationships]
M --> V1[View for business readers]
M --> V2[View for developers]
M --> V3[View for operations]
  • Diagrams are described as views of a model that is kept separate from them.
  • Each view states which stakeholders and concerns it addresses.
  • The conventions for each view type (viewpoint) are defined apart from the views themselves.
  • The documentation includes a building block view showing the static decomposition of the system.