# Inheritance

Writing spaces inherit from their prototype; when you give a note a prototype, you’re telling Storyspace, "this note is just like its prototype, except for the differences I describe."

Whenever Storyspace looks up the value of an attribute, it reviews the following checklist:

- If the note has a value for that attribute, that’s the value.

Otherwise,

- If the note has a prototype, and if the prototype has a value, then we inherit the prototype’s value.

Otherwise,

- If the prototype itself has a prototype, we inherit that value.

Otherwise,

- We use the default value for that attribute.

Note that inheritance has nothing to do with the document hierarchy; a note’s prototype is not necessarily its container. For example, Amy’s Hangover and William’s Bad Idea might be two writing spaces. Each has the prototype “Prom”. One is inside the container “Things Unravel,” the other is inside “Looking Back.”

A note’s own values always override inheritance. For example, suppose that note Prototypical Task is gray. We create a new note called Today's Meeting that inherits from Prototypical Task. Initially, Today's Meeting inherits everything from its prototype, so it’s gray, too. But if we set the `Color` of Today's Meeting to blue, it turns blue. Other tasks remain gray.

Now, we make yet another note, Conference Call, which also inherits from Prototypical Task. It, too, is gray, because Prototypical Task is gray.

But perhaps we’d like all tasks to be green; we change the `Color` of Prototypical Task to green. Now, Conference Call turns green, because it inherits its Color from the prototype. Today's Meeting remains blue, because you gave it a specific color; a note’s own values always take precedence over inheritance.