next up previous contents index
Next: Flow Diagrams Up: Examples Previous: Mail Reader   Contents   Index


Blackboard

This "Real World Example" comes from [2]:
"A blackboard is used for leaving messages to people.

When we visit the blackboard we can read from it and write to it (and make a photo of it).

When we are left (disconnected) we can watch an old photo of the blackboard and write messages onto the photo.

When we visit the blackboard we can decide which of the messages on the photo that are still actual to write to the blackboard.

Too old photos are not acceptable and to long time until coming back to the blackboard is not acceptable.

-$>$ Time seems in most cases important!

-$>$ The world consists of cooperative processes!"

A "Class Example" is also given:


class Blackboard(rows,columns: Integer)->(self: Blackboard)
  const Interface:=[Write,Erase,Read]
  const ReadBound:=30*60 {seconds}
  const WriteBound:=20*60
  const Board:=Arrayd2D(rows,columns,var Char)

  function Read(x,y: Integer)->(t: Text)
    {read (local) board}
  end

  operation Erase()
    {erase (local) board}
  end

  operation Write(x,y: Integer, t: Text)
    {check for space and update (local) board}
  end

  operation MergeReplica(rep: Blackboard)
    {executed for primary replica}
  end
end

Note: Instead of making a photo when you visit (connect to) the blackboard (the server) you might read what is on the blackboard (shared data) and write a copy of what you find interesting (or might find interesting at a later stage) on your own miniature blackboard (client cache). When you are away (disconnected) from the blackboard, you can write messages (updates) onto the miniature blackboard.

While away, you might at some point think that the information on the miniature blackboard has become outdated and decide to phone (establish a weak connection) someoneB.1 who can confirm whether the information is out-of-date or not. If it is outdated, and you can afford the larger phone bill you can decide to retrieve the newest information and update the miniature blackboard. On the other hand if it was not long ago you left the blackboard or you do not have the strength to do an "update session" over the phone you might think that the information you have will suffice.

When you return (re-connect) to the blackboard, you decide to let one of your obedient studentsB.2 transfer your writings on the miniature blackboard to the big blackboard. The student runs into problems if there is discrepancy between what is on the blackboard and what you have written. If the student is clever enough she solves any inconsistencies herself (automatically), but, if the problem is really bad, she might return to you and let you do it yourself (manually).



Footnotes

... someoneB.1
In my case the server, so we have a sort of talking blackboard--NOW THAT IS SOMETHING NEW!
... studentsB.2
The server again, this blackboard is ending up very sophisticated--INDEED!

next up previous contents index
Next: Flow Diagrams Up: Examples Previous: Mail Reader   Contents   Index

michael@garfield.dk
2000-10-13