Appendix - A Domain Modeled in Refine


Introduction

This note describes a domain analysis for Internet browser applications. The results of the domain analysis are presented as an object-oriented framework using the Refine software engineering tools.

An Object-Oriented Analysis of the Internet Browser Domain

We performed a noun-verb analysis on the first chapter of Brenner and Aoki, Introduction to CGI/PERL; the source text is given in the source text. The procedure for the analysis is taken from Rumbaugh et al., Object-Oriented Modeling and Design as described by Nanduri and Rugaber, Requirements validation via automated natural language parsing.

The table below shows the forty most frequently appearing words from the source text. The forty most frequently appearing words constitute 37% of all words in the the source text (there are approximately 500 different words in the source text, and approximately 400 of them appear once).

61 server 9 content-type header 5 display 4 programs
36 script 8 file 5 cgi scripts 4 interact
24 browser 7 sends 4 you 4 hyperlink
23 client 7 html text 4 world wide web 4 gateway program
14 user 7 cgi script 4 web browser 4 delivers
12 information 6 text 4 servers 4 communicate
11 scripts 6 return 4 sent 4 acts
11 output 6 headers 4 retrieving 3 web server
11 data 5 receive 4 <> receives 3 url
10 request 5 program 4 protocol 3 starting

Table - The forty most frequently appearing words in Chapter 1 of Introduction to CGI/PERL.

A Refine Model of the Internet Browser Domain

Indicate this is Refine code
->]
!! in-package("RU")
!! in-grammar('user)

All objects in the model are subclasses of the ooa-object class.

<ooa.re>+= [<-D->]

var ooa-object: object-class subtype-of user-object

Because you can't have too much indirection, define ooa-bubble, a subclass of ooa-object. Each object in the model will be an instance of the ooa-bubble class.

<ooa.re>+= [<-D->]
var ooa-bubble: object-class subtype-of ooa-object

Attributes

The name of an OOA bubble is the name of the object class represented by the bubble.
<ooa.re>+= [<-D->]
var ooa-bubble-name: map(ooa-bubble, string) = {| |}

The attribute has-subclass represents the subclass-of relation. The object pair (x, y) is in the subclass-of relation if object x has object y as a direct subclass. The object x could have several subclasses; this is modeled by giving has-subclass a set-valued range.

<ooa.re>+= [<-D->]

var has-subclass: map(ooa-bubble, set(ooa-bubble)) = {| |}

Given the subclass relation, the superclass relation immediately follows: if the object pair (x, y) is in the subclass relation, the object pair (y, x) is in the superclass relation; that is object y has object x as a superclass.

<ooa.re>+= [<-D->]

var has-superclass: map(ooa-bubble, set(ooa-bubble)) = {| |}

Refine has constructs to maintain the relation between has-subclass and has-superclass as either of the attributes change.

<ooa.re>+= [<-D->]
form subclass-superclass-relation
  define-fun-converses('has-subclass, 'has-superclass)

The attribute part-of represents the part-of relation. The object pair (x, y) is in the part-of relation if one or more instances of object x are used as parts of object y. Instances of object x could appear as components in several classes, so the attribute part-of has a set-valued range.

<ooa.re>+= [<-D->]

var part-of: map(ooa-bubble, set(ooa-bubble)) = {| |}

And again: given the part-of relation, the consists-of relation immediately follows: if the object pair (x, y) is in the part-of relation --- that is, the object x is part of the object y --- then (y, x) is in the consists-of relation; that is object y consists of the object x.

<ooa.re>+= [<-D->]

var consists-of: map(ooa-bubble, set(ooa-bubble)) = {| |}

form part-consists-relation
  define-fun-converses('part-of, 'consists-of)

A Model

There's now enough support on hand to create a model of the system.
<ooa.re>+= [<-D]

constant server-obj: ooa-bubble = make-object('ooa-bubble)
ooa-bubble-name(server-obj) <- "server"

Internet Browser Domain Analysis

The domain analysis begins with a system architecture for Mosaic developed by members of CS 8113D - Principles and Aspects of Software Design, Winter Quarter, 1996. The overall architecture is identified as being event driven, but it is unclear if this refers to the architecture of interactions between the UI Manager and User Input Devices or between any two components.

The Internet Browser Domain Framework

Framework Objects

Indicate this is Refine code
<ibdf.re>= [D->]
!! in-package("RU")
!! in-grammar('user)

The Refine Language Manual recommends defining a primal object from which all other objects in the framework are descended.

<ibdf.re>+= [<-D->]

var internet-browser-framework-object: object-class subtype-of user-object

There seem to be at least two classes of objects in the domain: objects internal to the browser and objects external to the browser.

<ibdf.re>+= [<-D->]
var internet-browser-manager-object: object-class
      subtype-of internet-browser-framework-object

var internet-browser-external-object: object-class
      subtype-of internet-browser-framework-object

We will further divide external objects into two sub-classes based on whether an external object has a thread of control or not. An external object with its own thread of control is an active external object; an external object without a thread of control is a passive external object. The Hotlist file is an example of a passive external object; the Lpr Daemon is an example of an active external object.

<ibdf.re>+= [<-D->]

var internet-browser-active-external-object: object-class
      subtype-of internet-browser-external-object

var internet-browser-passive-external-object: object-class
      subtype-of internet-browser-external-object

Attributes

We will define two attributes between objects. One attribute expresses data movement between pairs of objects, while the other attributed expresses control movement between pairs of objects.

The data attribute is passes-data-to. The object pair (x, y) is in passes-data-to if object x passes data to object y. The object x could pass data to several other objects, so passes-data-to is a relation between objects, which is modeled by giving passes-data-to a set-valued range.


var passes-data-to:
      map(internet-browser-framework-object,
          set(internet-browser-framework-object))

Similarly, the object pair (x, y) is in the control attribute passes-control-to if object x passes control to object y.


var control-data-to:
      map(internet-browser-framework-object,
          set(internet-browser-framework-object))

The Source Text

This text is taken from Chapter 1 of Brenner and Aoki, Introduction to CGI/PERL. It contains only the nouns, verbs, and adjectives in the original text; there are no adverbs. The page, paragraph, and word order below is the same as in the original text. The adjectives are not separated from the associated nouns. Periods are used to delimit the extent of each noun or verb phrase found.

Page 1

world wide web . content . authoring tools . web's . publish . audience . common gateway interface cgi . web applications . internet dynamic web pages . html text files . programs . scripts . create . html source text . web browser . displays . scripts . generate . documents . incorporating . information . solicit . interpret . user supplied data . retrieve . requested information . produce . content . customized . user scripts . accomplish . tasks . cgi scripting . script . receives . outputs . information . communications path . web scripts . interact . users

Page 2

communicate . web servers . relay . information . web browser . display . intermediate layers . process . web programming scripts . interact . web browsers . servers . static html files . requested . displayed . users . simple html page . source . produces . output

Page 3

we . created . html text . delivering . web browser . serving . simple pages . coordination . browser . web server . page . stored world wide web . client server model . server . provides resources . client . requests . resources . computing power . information store . peripheral . client and server . software programs . reside . same machine . different machine . machine . acts . server . client . client . server . client and server . agreed . mechanism . communicate . mechanism . protocol local television station . television station . resources . video tapes . live cameras . satellite feeds . you . turn on . tv . watch . program . television set . acts . client . broadcast station

Page 4

server . client . tied . specific server . you . change channels . get . programming . different stations . stations . agreed . speak . same language . broadcasting . signal . particular frequency . television set . understands . protocol . receive . station . local tv station . act . client . server . television network . delivers . movies . programming . evening news . station world wide web . client . played . web browser . web server . software . delivers . resources . computer files . images . movies . sound . browsers . servers . world wide web . browser . television station . use . protocol . hypertext transfer protocol http . http . exchange requests . responses . request . command . action . sent . browser . server . carried out . server . performs . requested service . returns . answer . response html file . server's disk . computer's screen . relationship . user . client . server . communications . http process . simple transactions requests . responses . user . asks to see . hello world page . browser . establishes . connection . server

Page 5

sends . request . http protocol . request . travels . server machine . locate . specified file . finding . file . server . sends . client . file's contents . header set . provide . additional data . transaction . server . breaks . connection . waits . request . client response . client . receives . header . message body . http headers . contain . meta-data . displayed . user . header lines . status code . the file's last modification date and time . file's content-type content-type header . tells . client . interpret . information . picture . text . sound . encoded . message body . server . determines . file's type . return . content-type header . data . server . mapping . file's extension . contents type . .html extension . indicates . html text . server . knows . media type . file . ends . .html . text/html . sets . content-type header . client . header line . determine . response contents . browser . decode . display . picture . audio information . played . external helper application . browser . interprets . tags . display

Page 6

www interaction . user . client . server . client . acts . intermediary . user . server

Page 7

user . sees . url . clicks . hyperlink . enters . browser . www browser . interprets . url . computer . contains . file . file . is located . communicate . machine . browser . sends . get request . http protocol server . located . information . sent . request . file name . server . receives . parses . request . file's extension . determines . information type . file . browser . file's content-type . server . sends . file contents . browser . http response . server . client . headers . indicate . request . data . returned . content-type: text/html . headers . html data . content-type header . browser . data . html . browser . formats . renders . text . highlighting . hyperlinks . user . views . html output . select . hyperlink . starting . cycle . information flow . http transaction . client . requests . file . server . delivers . it

Page 8

simple model . retrieving . files . complex tasks . http server programs . obtain . pre-existing files . send . clients . complex data processing . retrieving . database information . searching . text . http servers features . modifications . server program . server program's source code . internal operation . http servers . additional capabilities . server . delegates . complex tasks . external program . script . database access . script . acts . gateway . intermediary . server . data repository . server . receives . database access request . passes . request . gateway program . get . data . return . results . server . server . repackages . information . forwards . information . client . clients . know . server . handled . request . offloaded . work . other . programs . interpret . returned result . display it . user relationship . gateway programs . server . communicate . interaction . specified . common gateway interface cgi . cgi protocol . defines . input . script . receive . server . output . return . server . script . script . cgi scripts . gateways . databases . data repositories . cgi programs . sophisticated processing . accessing . external data

Page 9

user . follows . hyperlink . enters . url . retrieve . hello wold page . destination . given . script . file . browser . script . address . retrieved . server . retrieving . file . executes . script . specified . address . starting . script . server . provides . information . machine name . browser type . server . include . specific information . user input from an html form script . generate . data . return . server . server . cgi script . query . database . p[perform . calculations . twiddle . proverbial thumbs . print statements . output . text

Page 10

client component . server computer . browser . http server . gateway program . communication . environment variables . standard i/o . http transaction components . script . called . cgi . user . client . script . server side . user . client . interact . server . server . manages . communication . script . information flow . http transaction . script . called . cgi . server . delegates . cgi script . scripts . added . http request . input . output . script . http communication . server . client

Page 11

client interprets url . get message . requesting . sent . www.company.com . server . starts . script . sends . information . environment variables . standard input . gateway program . processing . produces . output . program supplies . content-type header . data . server . content-type: text/html . headers . html text . generated . script . headers . data . program . server . received . data . gateway program . server . relays . information . client . http response . server . browser . response . status . content-type header . script . headers . html text . content-type header . browser . data . html . browser . formats . renders . text . highlighting . hyperlinks . user . views . html output . selects . hyperlink . starting . cycle

Page 12

cgi script . generates . header line . html page . first line . script . instructs . unix operating system . run . program . perl interpreter . directory location . windows . macintosh http servers . unix . unusual configurations . modify . programs . server . tell cgi script . script . document file . help . script writer . errors . cgi programmers . hints . server . confused server . generate . server . configured . script . called . most common result . script text . source code . output . execution result . you . receive . errors . message . posting . script . problems . arise . standards . server . recognize . cgi script . servers work . ways . model . used . nsca and cern servers . special directory . scripts . reside . actual directory location . disk . name . accessed . web . specified . configuration files . document request . directory . subdirectories . treated . request . execute . script document . servers . support . model

Page 13

newer approach . use . filename extension . recognize . cgi scripts . mirroring . media type technique . precise extension . defined . server's configuration . most common extension . scripts . .cgi . windows servers extensions . cgi scripts . servers' directory space . scripts . kept . intuitive locations . html files . documents . scripts . directory hierarchy . updated . the server . configured . access . documents . users' personal directories . mapping . urls . anyone . create . execute . cgi scripts . inexperienced users . write . cgi programs . major security holes . using . shell scripts . single user . jeopardize . security . entire server computer servers . extension-based cgi script recognition . disabled . enabled . internet service providers prohibit cgi scripts in user space . security hassles . run . cgi script . you . receive . access denied error . message . appears . file's permissions . set . incorrectly server . interact . script . client program . directly run . cgi script . browser . display . script's source code . cgi communications . server . script . cgi interaction . involve . http server

Page 14

server . care . script . generates . output . know . output format . script output . server input . web server . delivers . static file . browser . filename extension . determine . content-type header . scripts . script's filename . unrelated . return information type . script . return . image . data . return . html text . single script . output . different data types . context . called . script . notify . server . data type . generating . server . pass . information . client . first executed line . specifying . media type . identifies . message body data . \n combinations . follow . header information . translated . perl . newlines . first . ends . content-type line . second . inserts . mandatory blank line . separates . header . message script remainder . outputs . html text . beginning . tag . ending . . text . output . print statements . sent . server . executed . script . server . captures . output . constructs . http message header set . sends . headers . script output . browser . receiving . interpreting . data . browser . html text

Page 15

Page 16

cgi scripts . server . involved . process . server . start . script . send . proper information . pass . output . browser . script . work . division of labor . leads . protocol display . html document . interplay . web user . browser . server . cgi script . complicates . picture . server end . user . browser . knowledge . program . run programs . perform . functions . write . basic cgi scripts . produce . html page . generating . content-type header . printing . document text . program . script . simple program . illustrates . cgi scripting basics web client . communicates . server . hypertext transport protocol http . http transactions . performs . actions . retrieving . html page . executing . script . cgi . common gateway interface . specifies . information . server . sends . script . server . expects . receive . the browser . execution . script . retrieval . static page . communication . script . mediated . server . scripts . distinguished . html documents . placed . separate directory . having . .cgi file suffix

Page 17

script output . starts . content-type header . identifies . script output media type . header . followed . blank line