Director Web : OOPs

Peter Small's Dinner Party

Date:    Tue, 9 May 1995 18:57:00 +0000
From:    Peter Small <peter@GENPS.DEMON.CO.UK>
Subject: I got invited to a dinner party
Hi folks,

I got invited to a dinner party last week.

I don't usually get invited to these kind of functions but apparently somebody else had been invited who was also in computers and the hostess invited me to sort of entertain him if he got bored. My wife knew better but wasn't consulted.

I recognized the computer buff as soon as I sat down at the table: a white faced, plumpish type with the typical humpy back of a dedicated hacker. He was talking to a pregnant lady who was sitting opposite me.

"I don't know much about parenting" I heard the hacker say. Seizing the opportunity to open up a conversation, I broke in to say "Hey, I'm in to parenting and all that child stuff". "Really?" the pregnant lady answered, smiling at my wife. "Yes", I've just built this space ship which I want to send across the net."

My wife gave me a daggery sort of look, but, as I didn't want the conversation to flag, I continued "I give birth to a captKirk who is my child controller".

"Captain Kirk? Child controller", asked the hacker incredulously. "Yes, I know it doesn't make much sense at this early stage, to go to the bother of using a child, but, I want to develop the ship as I go along. If I can build up things as a series of objects right from the beginning it will be much more flexible as and when things develop.

As I swept out my arms to indicate the extent of the expansion, my arm knocked over my wife's glass of wine.

"Oops!" exclaimed the hacker.

"That's right" I said. "It's like Grady Booch explains in his book on Object Oriented Design: you start with a simple object and, once you get that working properly, you add new objects to the system as you get it to do more and more complicated things."

"How many children do you have?" the pregnant lady asked. "Just the one at the moment; just captKirk" My wife tried to break in, muttering something about us having two children, but she didn't understand what I was talking about.

"Look, I'll show you", I said, getting out my pen. On my paper serviette I wrote down the parent script for captKirk:

Property craftName,starBase,starSystem,Planet,mission
 

on birth me
  set the craftName of me to the movie
  set the starBase of me to the pathName
  return me
end
 

 
on doMission me,starSys,plan,miss
  set the starSystem of me to starSys
  set the planet of me to plan
  set the mission of me to miss
  append the searchPath,the starBase of me
  append the searchPath,the starSystem of me
  go movie the planet of me
  copyToClipboard cast the mission of me
  go movie the craftName of me
  put findEmpty(cast "StartCargo") into nextEmptyCast
  pasteClipBoardInto cast nextEmptyCast
  saveMovie
end
"That looks very complicated" said the hacker.

"Yes, I know, it is complicated for the first simple mission, but, the structure is designed to be a base for more complex missions later" "Missions?" queried the hacker. "Yes", the first mission is simply to pick up cast objects from different movies" I scribbled the mission handler on his serviette:

on doTheMission
  global captKirk
  set assList to the value of field "assList"
  set captKirk to birth(script "kParent")
  doMission captKirk,"Solar system:","Uranus","ob1"
  set the collectList of captKirk to the value of field "ob1"
  repeat with i in the collectList of captKirk
    doMission captKirk,"Solar system:","Uranus",i
  end repeat
end
"Can you see, how this doTheMission handler gives birth to captKirk and using three parameters with the doMission command tells captKirk to find a planet (movie) called "Uranus" on a volume named "Solar System"."

The hacker looked puzzled, so I continued.

"CaptKirk then gets a cast list from "Uranus" ("ob1" is a field which lists the cast numbers of a complete object) and puts them in his collectList. CaptKirk then proceeds to keep beaming down to "Uranus" picking up these cast members in his collectList, one at a time, and loading them into his cargo hold (cast window).

In this way I can send captKirk, in his space ship, to any hard disk on the net to retrieve complete objects."

"What are you going to do with these objects?" asked the pregnant lady, who now had a very amused expression on her face. "I'm going to use them like Lego parts to build a new movie" I told her.

My wife was frantically signaling our hostess.

"Peter," the hostess gushed, "I'd like you to come over and meet John who is in computers"

"Another one?" I laughed.

"No?" she said in puzzlement.

"Well there are two of us here," I said, pointing to myself and the hacker.

"He's not in computer's," said the hostess.

"No, I'm a Doctor" said the hacker, I haven't the faintest idea what computers are all about."

"A Doctor?" I mused. "Then you must know about viruses then.

"Yes" laughed the Doctor.

"Well why didn't you tell me," I scolded, "Do you know my spaceship is being designed along the lines of a virus. I am going to program it to copy objects from CD-ROMs to construct movies in the same way as viruses copy proteins from DNA and did you know that the list structures in Lingo are perfect for creating neural networks..."

At that point, my wife went into one of her hysterical screaming fits and we had to go home. I think this is why we aren't invited to many dinner parties.

Regards
Peter Small

"Resolve to die in the last dyke of prefabrication." - Edmund Burke (1729-1797)