jonnify·bcs /bcs/elixir-core/otp-application

B2.1 · dive 1 of 3

A system is an OTP application.

The first clause made concrete: the boundary is a supervised process. A pure core decides; a GenServer shells it; a supervisor starts one property store per namespace.

One system’s anatomy: supervisor, shell, core, table. Select a part.
Bcs.Supervisorrestarts a fallen child GenServer · owns the table, serializes callscallreplythe process = the boundary pure corea total function ETS · :private
readout · Select a part. A system is a supervised process: a pure core, a GenServer shell that owns the table, under a supervisor.
§1

The idea

echo_data · bcs/supervisor.ex

The law’s first clause — a system owns its state behind a boundary no other system reaches through — is, on the BEAM, a sentence about processes. A system is a supervised process; its state is unreachable except by message, so the runtime enforces the boundary rather than leaving it to discipline. EchoData.Bcs.Supervisor brings the system up: start_link(stores) starts one EchoData.Bcs.PropertyStore child per {name, namespace}, each a supervised boundary under one tree, and restarts a child that falls.

Inside a system the pattern is pure-core-and-shell. The decisions are total functions with no side effects; the GenServer is a thin shell that owns the ETS table and serializes access to it. A call arrives, the shell hands the relevant state to the pure core, the core returns a decision, and the shell applies it and replies. The interesting logic stays testable without a running process, and the effects live at the boundary.

The system topology is therefore a supervision tree of branded boundaries. A namespace is not a string prefix on shared rows; it is a process with its own private table and its own gate. Adding a system is adding a child to the tree, and the tree is the architecture made executable — ownership, isolation, and restart, all from the runtime.

The six dives are in the module: B2.1 · A System Is an OTP Application.

§4

The doors

the sibling courses
§2

References

sources · related

Sources

Related