[MUSIC PLAYING]
Hi, I'd like to show you a system
we have developed for building distributed applications.
It's called Visual Obliq, and consists
of an Interface builder and runtime support
to distribute computation.
The primary goal of the project is to make it as easy to build
a distributed multi-user application as it is to build
a single user application using state-of-the-art tools.
Watch now as we use Visual Obliq to build
a simple but non-trivial distributed multi-user
application.
Starting with an empty workspace,
I'll add a form widget.
And I'll resize it to make a little bit bigger.
Next, I'll come back to the pallet of widgets
and click on the Text widget.
I'll position and size this one also.
When I double-click on a widget, an attribute sheet appears.
Here, I'll change the value of the text widget to be,
Hello Visual Obliq.
And I'll also make the font a little bit bigger.
When I click on the Apply button,
these changes all take effect.
Now, to make this a little bit more interesting application,
I'll add a file browser and also a text editor.
I'll double-click on the file browser
to bring up its attribute sheet.
And I want to change its name to be just the letter F.
I'm also going to add some callback code.
This code, written in the Obliq programming language,
is invoked when the user specifies
a file name in the widget.
The callback is simple.
First, let n equal SELF.f.getFilename This
assigns the specified file name to the variable n.
As we shall explore in more detail later, in Visual Obliq,
there can be multiple instances of each form.
SELF is used within a callback to refer to the instance
where the callback occurred.
SELF.f refers to the widget called f within that form.
And getFilename is a method of a file browser,
and it returns the name that was selected.
The line, let t equal LOCAL.LoadFile of n
causes the contents of the file given by the variable n
to be loaded into the variable t.
And finally, SELF.edit.putText of t stores the contents
of variable t--
remember, that's the contents of the file--
into a widget whose name is edit.
We'll hit Apply to make these changes happen.
And the last thing we need to do is
to change the name of the text editor to be simply edit.
Done.
Go back to the GUI Builder, hit the Run button.
In a few seconds later, right about now,
the application appears.
The file browser lets us select a file name.
We'll pick the file AboutSRC.
And in the text editor, we can do whatever
editing we'd like to do.
Let's now convert our application
into a distributed one in order to allow multiple sites
to share the editor.
First, I'll delete the Hello Visual Obliq banner and also
the file browser.
Next, I'll give the form a name, MUE.
The shared editor will work as follows.
After each keystroke, we'll retrieve the entire contents
of the editor where the user just typed and store this text
into the Text Editor widget of all the instances
of the application.
The callback for the text editor is as follows.
Let t equal SELF.edit.getText.
This retrieves the text.
For each m in MUE do.
This loops through all of the instances of the form
named MUE.
m.edit.putText-- this statement stores the text
at the widget named edit at each instance.
Our application also needs a mechanism
to invite other users to join in.
I'll add a type-in widget to let the user specify a site where
there's another potential participant.
I'll call the type-in W. And the callback for it is a two-liner.
Let site equal SELF.w.getText.
This retrieves a text from the type-in field.
installAt of site-- this calls a built-in procedure, installAt,
to invite the user at some site to join the session.
If the user agrees, Visual Obliq sends code
to that site causing a copy of the shared editor
to be created there.
The editor, as it stands now, does not
have any floor control policy.
Every time any user enters a character,
it appears at all sites.
Adding rudimentary floor control is easy.
I'll have a grab button that a user must click in order
to get control of the floor.
And I'll also have a status message informing all the sites
of the user who has the floor.
The status message is a piece of text.
The name of this widget is Message, MSG.
I'll change the font to be big so you
can read it on the video.
And I'll also give it initial value of Floor with Nobody.
The grab button will have a label called GRAB!
with an exclamation mark.
And it's called callback is as follows.
For each m in MUE do, m.msg.putText Floor with--
and we'll concatenate that with the host name.
So this will cause the status message in all of the instances
to be updated.
If m isnot SELF, then m.edit.makePassive--
all the instances other than the one where
the user clicked the GRAB!
Button will become passive--
else, m.edit.makeActive.
So the site where the user clicked on the GRAB! button
is the only one that becomes active.
Oops, typo, there we go.
And this is the entire application.
We can run this application by going back
to the Visual Obliq Application Builder
and hitting the Run button.
Well, now I'll hit the GRAB! button.
You can see that I'm on the machine called Castle.
"Hi Mom, I am on CASTLE.
I now like to invite Krishna to join in this editor.
Krishna is at a site called Magician.
And the inset video is showing Krishna's screen right now.
I guess he's looking at the SRC homepage through Mosaic.
I'll invite him right now.
And a window pops up on his machine.
And it says, "You are invited to session of Multi-Editor."
Hopefully, Krishna will accept our invitation
by clicking on the green Accept button.
This causes the application to migrate to his machine.
Since I still have the floor, I'll
ask Krishna if he wants to go to lunch.
"Want to go to lunch?"
Let's see.
Now Krishna has grabbed the floor.
You can see the floor's with Magician.
And he's suggesting that we go to Gordon Biersch in 15
minutes.
Well, that sounds pretty good, so I better
finish up this video.
I hope that the video has given you a feel for how easy and fun
it is to build distributed multi-user applications using
Visual Obliq.
[MUSIC PLAYING]