Comet has a pile of index cards and two colored pens. On the top card she writes Sample, then lists label, kind and grams.
"That is the class card," she says. "Now I fill one object card for each real sample, with real values."
Wren holds up a lamp from the shelf. "What does the evidence say?" he asks. "Could a lamp have a class card too? It has parts and it does things."
Nova casts a soft glow on the lamp. "How can I help?" she asks. "List what every lamp has, then what every lamp can do."
Comet passes you a blank card. "Find a family member, lead programmer. Pick something at home."
An object is one instance of a class. The class is the blueprint for the attributes and behaviors every object of that type has.
A class card lists the attributes and behaviors. An object card gives one object's own values for each attribute.
| Card | Attributes | Behaviors |
|---|---|---|
| Class card: Lamp | color, brightness, is_on | turn_on, turn_off, describe |
| Object card: desk lamp | color = green, brightness = 3, is_on = False | (same as the class) |
| Object card: hall lamp | color = white, brightness = 5, is_on = True | (same as the class) |
Great teamwork. Next week Pip gets a class of its own, and the crew learns to guard its state.