Lesson 3 of 7 · 2 min 36 sec

The Public Door

Chapters

  1. A door is a contract
  2. Two different refusals
  3. Queries, controllers and peers
Transcript
Download transcript

A door is a contract

Everything outside reaches the school through a public method. Think of each one as a door, and write three things on it. Who may come through. What they may ask for. What they get back. That is a contract, and it is yours to design. Write it as a table: method, caller, allowed when, reply. Notice what is missing. No method asks the caller which student they are. The school works that out from who is calling.

Two different refusals

Mira tries to record a score of one hundred for Sol. The door asks Courses one question: who teaches course twelve? Tov does. Mira is not Tov. She stops at the door and gets the reason. Nothing inside was asked to change. Now Tov tries to change Sol's score to sixty. Tov is the instructor, so the door opens. Office builds the action and dispatches it. The roll looks at its own state: Sol is already scored. It refuses. No prepared change, no block. There is no third way in. No door leads to the roll's memory, to Settings, or to anyone's memory. Passing a door gives you a request. It never gives you the data.

Queries, controllers and peers

Reads get doors too. A query door changes nothing, and it still has a caller rule. Mira may read her own transcript. Later today Mira will hold ticket seven, and Ode will not be able to read its status. And one locked door is for the controller alone: the dean sets the pass mark. Cross to the registry. Its authority is different, so its doors are different. Suspend, reinstate, accredit and revoke are locked to the board. Verify is open to anyone, and it only reads. Mira cannot suspend her own school, and neither can the dean. One door is left, and its caller is not a person. To issue a card, the caller must be a school canister that the board has added as a peer. The registry knows which school by who delivered the message, never by a name inside it. And that school may ask for one thing only: issue a card, for a course it is accredited to teach, while it is in good standing. It cannot revoke. It cannot speak for another school.