UML Extension for Web Applications 0.91

Drafted by jim conallen,
jim@conallen.com
Principal Consultant, Conallen, Inc.

Last updated: 22-Mar-1999

Description

This extension to the UML defines a set of stereotypes, tagged values and constraints that enable us to model web applications. The stereotypes and constraints are applied to certain components that are particular to web applications and allows us to represent them in the same model, and on the same diagrams that describe the rest of the system.

The principal element specific to web applications is the web page. There are several stereotypes that can be applied to a web page, and additional stereotypes are assigned to other elements of HTML that represent architecturally significant components of the system (frames, targets and forms).

Many of the tagged values mentioned in this extension may be considered presentational rather than structural. This extension has erred on side of two much information rather than omitting valuable tagged value specifications. It is expected that as code generators are developed, additional tagged values will be added to the extension.

Prerequisite Extensions

This extension requires no other extension to the language for its definition.

Stereotypes

Name

Server Page

Metamodel Class

Class

Description

A server page represents a web page that has scripts that are executed by the server. These scripts interact with resources on the server (databases, business logic, external systems, etc). The object’s operations represent the functions in the script, and its attributes represent the variables that are visible in the page’s scope (accessible by all functions in the page).

Icon

Constraints

Server pages can only have relationships with objects on the server.

Tagged Values

Scripting Engine – Either the language or engine that should be use to execute or interpret this page ( JavaScript, VBScript, Perl, etc.)

 

 

Name

Client Page

Metamodel Class

Class

Description

An instance of a client page is an HTML formatted web page. Like any HTML page it is a mix of data, presentation and even logic. Client pages are rendered by client browsers, and may contain scripts that are interpreted by the browser. Client page functions map to functions in scripts tags in the page. client page attributes map to variables declared in the pages script tags that are accessible by any function in the page (page scoped).

Client pages can have associations with other pages, client or server.

Icon

Constraints

None

Tagged Values

TitleTag – The title of the page as displayed by the browser.

BaseTag – The base URL for dereferencing relative URLs.

BodyTag – The set of attributes for the <body> tag that sets background and default text attributes.

Name

Form

Metamodel Class

Class

Description

A class stereotyped as a «form» is a collection of input fields that are part of a client page. A form class maps directly to the HTML form tag. Its attributes represent the HTML form’s input fields (input boxes, text areas, radio buttons, check boxes, and hidden fields).

A «form» has no operations, since opertations can’t be encapsulated in a form. Any operations that interact with the form would be the property of the page that contains the form.

Icon

Constraints

None

Tagged Values

Method – the method used to submit data to the action URL, either GET or POST.

 

 

Name

Frame Set

Metamodel Class

Class

Description

A frame set is a container of multiple web pages. The rectangular viewing area is divided up into smaller rectangular frames. Each frame may be associated with a single named «target», although not necessarily.

The contents of a frame may be a web page or another frame set.

A frame set stereotyped class maps directly to a frameset web page, and the HTML frame tag.

Because a frameset is a «client page», it too can have operations and attributes, but these are only activated by browsers that do not render frames.

Icon

Constraints

None

Tagged Values

Rows – The value of the rows attribute of the HTML <frameset> tag. This is a string with comma delimited row hieghts.

Cols – The value of the cols attribute of the HTML <frameset> tag. This is a string with comma delimited column widths.

Name

Target

Metamodel Class

Class

Description

A target is a named compartment in a browser window where web pages can be rendered in. The name of the stereotyped class is the name of the target. Typically a target is one frame in a window defined by a frameset, however a target could be a completely new browser instance or window.

«Targeted link» associations specify targets as the place where a new web page is to be rendered.

Icon

Constraints

A target’s name must be unique for each client of the system. This means that only one instance of a target can exist on the same client.

Tagged Values

None

 

 

Name

JavaScript

Metamodel Class

Class

Description

On a JavaScript enabled browser it is possible to simulate user defined objects with JavaScript functions. «JavaScript» instances exist only in the context of client pages.

Icon

Constraints

None

Tagged Values

None

Name

Link

Metamodel Class

Association

Description

A link is a pointer from a client page to another «Page». In a class diagram a link is an association between a «client page» and either another «client page» or a «server page». A Link association maps directly to the HTML anchor tag.

Icon

None

Constraints

None

Tagged Values

Parameters – a list of parameter names that should be passed along with the request for the linked page.

Name

Targeted Link

Metamodel Class

Association

Description

Similar to a «link» association, a «targeted link» is a link where the associated page is rendered in another target. This association maps directly to the HTML anchor tag, with the target specified by the tag’s target attribute.

Icon

None

Constraints

None

Tagged Values

Parameters – a list of parameter names that should be passed along with the request for the linked page.

Target Name – the name of the «target» that the page this link points to should be rendered in.

Name

Frame Content

Metamodel Class

Association

Description

A frame content association is an aggregation association that expressing a frame’s containment of another page or target.

A frame content association can also point to another frameset, indicating nested frames.

Icon

None

Constraints

None

Tagged Values

Row – An integer indicating the specific row of the frame in the frameset that associated page or target belongs in.

Col – An integer indicating the specific column of the frame in the frameset that associated page or target belongs in.

 

 

Name

Submit

Metamodel Class

Association

Description

A «submit» association is always between a «form» and a «server page». Forms submit their field values to the server through «server pages» for processing. The web server processes the «server page», which accepts and uses the information in the submitted form.

This relationship indicates which page (or pages) can process the form, and which forms a «server page» has some knowledge about.

Icon

None

Constraints

None

Tagged Values

Parameters – a list of parameter names that should be passed along with the request for the linked page.

Name

Builds

Metamodel Class

Association

Description

The «builds» relationship is a special relationship that bridges the gap between client and server pages. Server pages only exist on the server. They are used to build client pages.

The «builds» association identifies which server page is responsible for the creation of a client page. This is a directional relationship, since the client page contains no knowledge of how it came into existence.

A server page can build multiple client pages, but a client page can only be built by one server page.

Icon

None

Constraints

None

Tagged Values

None

 

 

Name

Redirect

Metamodel Class

Association

Description

A «redirect» relationship is a unidirectional association with another web page. It can be directed both from and to client and server pages.

If the relationship originates from a «server page» then it indicates that the processing of the page request may continue on with the other page. This does indicate that destination page always participates in the building of a client page, just that it could. This particular relationship is not completely structural, since the actual invocation of a redirection operation must be done programmatically in the code of the originating page.

If the relationship originates from a «client page» then this indicates that the destination page will automatically be requested by the browser, without user input. A time delay value can be set that specifies a delay (in seconds) before the second page is requested. This use of redirection corresponds to the META tag and HTTP-EQUIV value of "Refresh".

Icon

None

Constraints

None

Tagged Values

Delay – The amount of time a client page should wait before redirecting to the next page. This value corresponds to the Content attribute of the META tag.

Name

Object

Metamodel Class

Association

Description

An association between a client page and an object that is embedded in it. The object is typically a Java Applet or ActiveX control. This association maps in part to the HTML <object> tag.

Icon

None

Constraints

None

Tagged Values

Object Parameters – a semi colon delimited list of parameter names and optional values that should be placed in <param> tags in the <object> tag definition.

Name

IIOP

Metamodel Class

Association

Description

IIOP (Internet Inter-Orb Protocol) is special type of relationship between objects on the client and objects on the server. It represents a communication mechanism other than HTTP for client server communications.

Typically this relationship is between Java Beans on the client and Enterprise Java Beans on the server.

Icon

None

Constraints

None

Tagged Values

None

 

 

Name

RMI

Metamodel Class

Association

Description

RMI (Remote Method Invocation) is a mechanism for Java Applets and Beans to send messages to other Java Beans on different machines.

Typically this relationship is between Java Beans or Applets on the client and Enterprise Java Beans on the server.

Icon

None

Constraints

None

Tagged Values

None

Name

Input Element

Metamodel Class

Attribute

Description

An Input Element is an attribute of a «Form» object. It maps directly to the <input> tag in an HTML form. It is used to input of a single word or line of text.

The tagged values associated with this stereotyped attribute correspond to the <input> tag’s attributes.

To complete the required values for the HTML tag; the attribute name is used as the <input> tag’s name, and attribute’s initial value is the tag’s value.

Icon

None

Constraints

None

Tagged Values

Type - The type of input control to be used one of { Text, Number, Password, Checkbox, Radio, Submit, Reset }.

Size - Specifies how large an area to allocate on screen, in characters.

Maxlength – The maximum number of characters the user can input.

Name

Select Element

Metamodel Class

Attribute

Description

An input control used in forms. The select control allows the user to select one or more items from a list. Most browsers render this control as a combo or list box.

Icon

None

Constraints

None

Tagged Values

Size - Specifies how many items should be displayed at the same time.

Multiple– A Boolean indicating whether or not multiple items may be selected from the list.

Name

Text Area Element

Metamodel Class

Attribute

Description

An input control used in forms, that allows multiple line input.

Icon

None

Constraints

None

Tagged Values

Rows - The number of visible text lines.

Cols - The visible width of the control in average character widths.

 

 

Name

Page

Metamodel Class

Component

Description

A page component is a web page. It can be requested by name by a browser. A Page component may or may not contain client or server scripts.

Typically Page components are text files accessible by the web server, but they can also be compiled modules that are loaded and invoked by the web server. Ultimately when accessed by the web server (as either a file or executable) a page produces an HTML formatted document that is send in response to a browser’s request.

Icon

Constraints

None

Tagged Values

Path – The path required to specify the web page on the web server. This value should be relative to the web application’s (site’s) root directory.

 

Well-formedness Rules

Component Realization
Components may realize «server page», «client page» or «frameset» stereotyped classes.

Generalization
All the modeling elements in a generalization must be of the same stereotype.

Association
Client pages can have at most one «builds» relationship with a server page, yet a server page can have multiple «builds» relationships with different client pages.

Apart from standard UML combinations the following combinations are allowed for each stereotype:

To:

From:

Client Page

Server Page

Frameset

Target

Form

Client Page

Link
Targeted Link
Redirect

Link
Targeted Link
Redirect

Link
Targeted Link
Redirect

Dependency

Aggregation

Server Page

Builds
Redirect

Redirect

Redirect
Builds

   

Frameset

Frame Content

 

Frame Content

Frame Content

 

Target

         

Form

Aggregated By

Submit

     

Comments

To maintain some visual sense of consistency all "page" icons have a little "dog ear" in the upper right hand corner to convey the notion that they represent an entire web page (as seen either by the client browser or web server).

Code generators are expected to specify additional tagged values for class and association stereotypes. The tagged values specified in this specification are important enough to be considered either logically or structurally significant.