Install Once, Bind Every Time
Chapters
- The tree is built once
- The services are drawn on top
- A release that changes only rules
Transcript
The tree is built once
Go back to the first moment. The canister is created, and its memory is empty. How does this tree come to exist? The root does it, in its install function. First the root's own memory. It has four slots, and this file names them. Then the root asks each module for a new, empty memory and attaches it in its slot. Policy arrives with its starting rules. The root never sees inside any of them. It is all one step. A memory that was made and not attached would be discarded when the step ends. Notice what is missing. There are no shelves. A shelf is created later, by Branches, when an admin opens a branch. Install builds the fixed part of the tree. The rest grows with use.
The services are drawn on top
Memory alone does nothing. The root now binds a service to each module and builds Desk from them. This is the call graph from lesson two. Install builds the initial tree on a fresh installation. Restore opens the saved tree on upgrade. Both end with this same binding.
A release that changes only rules
Jump forward to day one-twenty. Two branches are open, five loans are out, and release one is installed. We want a new rule. A member with an overdue loan may not borrow again. That rule lives in Desk's code. No module saves anything new. Install release two. The old program lets go of its services. Every service band, the call lines, Desk, all of it. Services do not survive an upgrade. Memory does. The new program starts on the restore path. It creates nothing. It finds the root, finds each attached module, and binds the services again. The shelves that were opened last month are still on their keys. Member five-oh-two asks for a saw. Two loans, under the limit, and a saw is on the shelf. Yesterday this was a yes. But both of their loans were due before today. Release two says no. The data did not change. The rule did.