Editing Things

In our previous section, we were looking at Who owns each game:
3y2848u/2117307bd6c14928dbff04dddae92838406cab82.png
But I realize that that's not quite right -- I (Bill) picked up a copy of Red 7 recently, and I want to note that. So let's click on Red 7, which brings us to that:
3y2848u/3b2df57a34104ae215a3df15f2d0a3267fe7c06.png

A Little Terminology

As mentioned before, Querki is all about Things, but they come in a couple of different kinds -- in particular, Models and Instances:
  • A Model describes a sort of Thing. So for instance, "Game" is a Model that describes what a game is -- what Properties it has, how to display a game, and so on.
  • An Instance is a specific Thing, based on a particular Model. So Red 7 is an Instance of Game. In the illustration of the Red 7 page above, you see that the fine print says that its Model is Game. It's what we programmers call an is-a relationship: Red 7 is a Game. It's always correct to say "Instance is a Model", and that should make sense.
Every Thing in Querki is based on a Model, and Models can be based on other Models, adding more Properties to them. This way, you can describe what a whole bunch of Things look like, and then make pages based on that.
At this point, a lot of programmers out there are saying, "So Querki's an object-oriented system, right?" Kind of, but maybe not quite the way you're thinking.
The thing is, most OO languages such as Java or Scala or C# divide the world into classes and instances, and they are very different. A class is a description of an object -- it says what the fields are and so on -- but it is not itself an object. In most cases, classes are incomplete: they just say what properties exist, but not what values to put into them. That's not the way Querki works, and that's why Models aren't called Classes.
Instead, Querki is prototype-styled. It is more like JavaScript (or like MOO, for the old MUD hackers out there). A Model is a complete Thing -- it doesn't just declare the Properties, it provides default values for all of those Properties. That's important: it means that there is no such thing as a null pointer, with all its related horrors, in Querki. It means that every Instance is always valid. When it is created, an Instance is more or less identical to its Model, so it works from the very beginning; you then make changes to define what this Instance really means.
So Models are pretty much like JavaScript prototypes: completely valid Things that just happen to have other Things inheriting from them. Indeed, in early iterations of Querki the only difference between Models and Instances was the Is a Model flag, which you had to set explicitly. I gradually discovered that you really want them to behave differently in many ways, resulting in the current dichotomy, but under the hood they're still largely the same.
(You are also allowed to add additional Properties to individual Instances: Querki isn't as strict as an object-oriented programming language. But in general, Properties get defined on Models and filled in on Instances.)

Editing Red 7

As the other page says, this says only Julie owns a copy. So I click the Edit button, which is the icon that looks like a pencil pointing to a page (), and that shows the Instance Editor (which gets inserted at the top of the page):
3y2848u/3126ae1b95e99bd3f2909fb29f58ecb6655a2f5c.png
This shows all of the Properties defined for a Game, and what we're filled in for Red 7. What I want is to add myself to Owners, so I click on the empty white box in there and start typing:
3y2848u/f1fc47c95b58bcc2255bf15fbff3935dec6a7172.png
As soon as I start typing "Bill", it prompts with my full name. That is because the Owners Property has been set up to know about the members of our Game Night, and the only member whose name starts "bi" is me. So I can just press Enter, and I'm there:
3y2848u/3c852940347192bfd2d76bfe120e15b6e6f4e855.png
That's all we were trying to do, so I press the Done button at the bottom:
3y2848u/11a5f2329d5261378ba48ff7802a15cd3e139988.png
And we see that the page has been updated to include me:
3y2848u/dc0e39919cd437d5a0167f7b6fcc36d2543a6c22.png
The button at the bottom is named "Done" instead of "Save", because all changes get auto-saved pretty often: in particular, every time you go from one field to another, it gets saved. (In Large Text fields like Details, you may be able to press ctrl-s to save your work, but that doesn't yet work in all browsers.)
There is no undo built into Querki yet, so be a little careful about your changes. Undo, and a lot more powerful tools for being able to examine the history of your Space, should be coming in early 2016.
That's pretty much all there is to editing Instances. Now, what if you want to add a new one? That's the topic of the next page...