Home > Articles > Programming > Java

This chapter is from the book

This chapter is from the book

Modeling Web Pages

Web pages, whether scripted or compiled, map one-to-one to components in UML. Components are physical and replaceable parts of the system. The Implementation view of the model, also known as the Component view, describes the components of the system along with their relationships. See Figure 3.14 for a look at the diagramming types used in UML. In a Web application, this view describes all of the Web pages of the system along with their relationships with each other (such as hyperlinks). At one level, the component diagram of a Web system is much like a site map.

Since components represent only the physical packaging of interfaces, they are not suitable for modeling the collaborations inside the pages. This level of abstraction, which is extremely important to the designer and implementer, still needs to be part of the model. We could say that each Web page is a UML class in the model's Design view, also known as the Logical view, and that its relationships/associations to other pages represent hyperlinks. This abstraction tends to break down when you consider that any given Web page can potentially represent a set of functions and collaborations existing only on the server, while a completely different set may exist only on the client. Any server-scripted Web page that employs Dynamic HTML (client-side scripting) as a portion of its output is an example of this type of page.

Figure 3.14 Diagramming UML.

The immediate reaction to this problem might be to stereotype each attribute or operation in the class to indicate whether or not it is valid on the server or client side. It is at this point that our model, originally intended to help simplify things, starts getting quite complicated.

A better approach to the problem is the principle of separation of concerns. The behavior of a Web page on the server is completely different from its behavior on the client. While executing on the server, it has access to and relationships with server-side resources such as middle-tier components, databases, and file systems. That same page, or the streamed HTML output of the page, has a completely different behavior and set of relationships when on the client. On the client, a scripted page has relationships with the browser itself via the Document Object Model (DOM) as well as with any Java applets, ActiveX controls, or plug-ins that the page specifies. For serious designers, there can be additional relationships with other active pages on the client that appear in another HTML frame or browser instance.

Separating concerns, the server-side aspect of a Web page can be modeled with one class, while the client-side aspect is modeled with another. The two are distinguished through use of UML's extension mechanism defining stereotypes and icons for each server page and client page. Stereotypes in UML allow the defining of new semantics for a modeling element.

For Web pages, stereotypes indicate that the class is an abstraction of the logical behavior of a Web page on either the client or the server. The two abstractions are related to each other with a directional relationship between them. This association is stereotyped as «build», since server pages build client pages. In other words, every dynamic Web page whose content is determined at runtime is constructed with a server page. Every client page is built by a single server page at most; however, it's possible for a server page to build multiple client pages.

Hyperlinks are a common relationship between Web pages. Hyperlinks in a Web application represent navigation paths through the system. These relationships are expressed in the model with the «link» stereotyped association. As a rule, this association originates from a client page and points to either a client or server page. See Figure 3.15 for the makeASale relationships that can be diagrammed with the TogetherSoft tool.

Hyperlinks are implemented as a request for a Web page. Those Web pages are modeled as components in the Implementation view. Typically, a link association to a client page is equivalent to a link association to the server page that builds the client page. This is because a link is in reality a request for a page, not either of the class abstractions.

Because a Web page component realizes both page abstractions, a link to any of the classes realized by the page component is equivalent. Tagged values are utilized for defining the parameters that are passed along with a link request. The «link» association tagged value Parameters is a list of parameter names along with optional values that are expected and used by the server page processing the request.

Figure 3.15 Relationships in UML.

These stereotypes make it easier to model a page's scripts and relationships. The «server page» class's operations become functions in the page's server-side scripts; its attributes become page-scoped variables that are globally accessible by the page's functions. The «client page» class's operations and attributes also become functions and variables visible on the client.

The key advantage to separation of the server- and client-side aspects of a page into different classes is in the relationships between pages and other classes of the system. Client pages are modeled with relationships to client-side resources such as DOM, Java applets, ActiveX controls, and plug-ins. Server pages are modeled with relationships to server-side resources such as middle-tier components, database access components, and server operating system.

One of the biggest advantages of using class stereotypes when modeling the logical behaviors of Web pages is that their collaborations with server-side components can be expressed in much the same way as any other server-side collaborations. The «server page» is just another class participating in the business logic of the system. On a more conceptual level, generally server pages take on the role of controllers. They orchestrate the necessary business object activity to accomplish the business goals initiated by the browser's page request. See Figure 3.16 for an activity view of shopping within the SilverBooks sample application.

Figure 3.16 Sample application activity diagram.

On the client side, collaborations tend to be more complicated, partially due to the wide variety of technologies that can be employed. In the simplest form, a client page is an HTML document containing both content and presentation information.

Browsers render HTML pages using formatting instructions in the page or in a separate style sheet. In the logical model, this relationship would be expressed with a dependency from a client page to a «Style Sheet» stereotyped class. Since style sheets are primarily a presentation issue, they are often left out of the Application Design Model (ADM).

Forms

The principal mechanism for entering data in Web pages is the form. In an HTML document, forms are defined with <form> tags. Each form specifies the page to which it should submit itself. A form also contains a number of input elements that are expressed as HTML tags. The most common of these tags are <input>, <select>, and <textarea>. The <input> tag can be a text field, check box, radio button, push button, image, hidden field, or one of a few other less common types.

Modeling forms is achieved through the «Form» class stereotype. A «Form» has no operations because any operations that might be defined in a <form> tag are really owned by the client page. The input elements of the form are all stereotyped attributes of the «Form» class. A «Form» can have relationships with applets or ActiveX controls acting as input controls. Each form also has a relationship with a server page, which is the page that processes the form's submission. This relationship is stereotyped as «submit». Since forms are contained entirely in an HTML document, they are expressed in a UML diagram with a strong form of aggregation.

Frames

Use of HTML frames in a Web site or application has been a subject of debate since their introduction. Frames allow multiple pages to be simultaneously active and visible to the user. The most common browsers today allow multiple browser instances to be active on the user's machine as well. These pages can interact with each other through use of Dynamic HTML scripts and components. The potential for complex interactions on the client is significant, and the need for modeling this even greater.

The software architect decides whether frames or multiple browser instances are employed in an application. If frames are used, the model of this client-side behavior needs to be represented in the ADM. To model frame usage, define two more class stereotypes, «frameset» and «target», as well as the association stereotype «targeted link». A frameset class representing a container object maps directly to the HTML <frameset> tag. This class contains client pages and targets. A target class is either a named frame or browser instance that is referenced by other client pages. A targeted link association is a hyperlink to another page that is rendered in a specific target. The actual presentation specifics are, for the most part, captured by tagged values in the frameset and the associations. Two tagged values on the aggregation relationship between a frameset and a target, or client page, identify the frameset row and column in which the target, or page, belong. The tagged value Target on the targeted link association specifies the «target» where the page should be rendered.

In cases where a target is not aggregated with a frameset, a separate browser instance is used to render the pages. It should be kept in mind that this notation is expressing a single instance of a client machine. It is assumed that all multiple independent targets are running on the same machine, with the diagram expressing the client-side behavior of one client instance. Any other deployment configuration would need to be heavily documented in the model to be better understood.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020