Ambiorix (Conclusion): What AMXD Really Means
Grow through practice
No need to finish reading — test nowSeries conclusion. We have taken apart containers, the data model, the bus, ODL and naming; this post stops discussing APIs and answers one question: What does AMXD actually change?
One sentence
AMXD turns “program state” from scattered global variables into an addressable, observable, transactional object tree.
It is not “one more library”; it is a different way to organize a C program.
Where it sits
libamxrt runtime (lifecycle)
libamxo ODL (declarative assembly)
libamxb bus (ubus / D-Bus / PCB)
libamxd data model ← the subject of this post
libamxp patterns (timers / signals / scheduling)
libamxc containers (list / queue / variant)
libamxcanswers “how data is held”;libamxdanswers “where state lives, who may change it, and who knows after it changes”;libamxbanswers “how other processes find it”.
AMXD is the middle layer, and the center of gravity of the whole system.
Three things it unifies
1. State (parameters)
All shared state lives in one tree and is addressed by path:
Device.WiFi.SSID.1.SSID
Device.DeviceInfo.Uptime
There is no “which component holds this variable” problem — state has an address.
2. Behavior (functions / RPC)
Methods live on the object, next to its state:
Device.WiFi.reload()
Device.DeviceInfo.setLed(enable)
Local C calls, ubus, D-Bus, CLI and Web all end up on the same model.
3. Notification (events / transactions)
A write is not “quietly changing a variable”; it is:
- going through a transaction (atomic multi-parameter commit);
- producing events (subscribers get notified);
- interceptable, validatable and rejectable by action callbacks.
State changes go from “side effects” to “first-class citizens”.
Five engineering implications
1. Eliminate “global variables + getters everywhere”
As a C project grows, the usual decay is: a pile of extern globals, anyone can write them, and nobody knows after a change. AMXD gives state one entry point: read by path, write by transaction.
2. Components couple by “contract”, not by header
Components do not #include each other; they agree on object paths + parameter/method names. Implementations, processes and buses can change; the contract does not.
This is the real meaning of an “object container”: not stuffing objects into a container, but letting objects find each other through the model.
3. One model, many access paths
The same Device.WiFi.SSID.1.Enable:
- read/written directly by C code;
- called remotely over ubus/D-Bus;
- inspected from the CLI;
- exposed to Web/TR-181/USP.
No separate glue for every entry point.
4. Observable and testable
describe / list make tools generic: no dedicated debug command per module. Tests can build a DM in-process, with no bus and no hardware.
5. Evolvable
Structure is declared in ODL; adding parameters, instances or methods does not necessarily require consumer changes. Templates + instances make “many copies of the same configuration” (SSID, WAN, users) natural.
What it is not (boundaries)
- Not a database: no persistence by default; “persistent” is an attribute, not a storage engine.
- Not a bus: the bus is
libamxb's job; AMXD only manages the model. - Not dependency injection: Spring “sends dependencies in”; AMX “finds them by path” — lookup, not injection.
- Not a silver bullet: without discipline in naming, ownership and schema, the model rots too; hard real-time hot paths do not belong in it either.
The cost
- Learning curve: objects/parameters/functions/transactions/actions — a whole set of concepts;
- Build chain:
libamxc → libamxp → libamxd → libamxb → libamxo → libamxrt, quite a few dependencies; - Upfront modeling cost: if the structure is not thought through, changing the ODL later hurts more.
What you get is consistency: in a multi-component, remotely managed, long-lived firmware, consistency is worth far more than “writing a few fewer lines”.
What C engineers can learn from it
C's default path is “structs + globals + hand-written getters/setters”. Fine for small projects; out of control when they grow. AMXD offers a middle ground:
No GC, no VM, no heavy framework; just an object tree + paths + transactions to structure state management.
That is the most valuable thing to learn — not its APIs, but its way of organizing a program.
Series recap
- Why Ambiorix builds its own container
- Why I searched for a C container
- Object container, bus and data model
- Data model: objects/parameters/paths
- libamxc in practice
- libamxc vs STL
- Lists/queues vs glib/STL
- Annotations and ODL
- Ambiorix naming
- libamxd in practice: a complete runnable example
- Proving with code: why AMXD must exist
One last sentence
The meaning of AMXD is to make “state” a first-class citizen of the system instead of a by-product of code. From then on, anyone can find it by address, observe it, and change it — and changes are committable, notifiable and interceptable.
Comments 0
No comments yet — be the first!