Vous êtes sur la page 1sur 5

Rational Rose

Building a Web Application


Before you write and implement a web application, you should plan, diagram, and test
your plan using Rational Rose Web Modeler. Web applications that change the state
of your business logic are complex. A web application extends the functionality of a
web site to change the state of your business. Imagine what could happen if you
implemented a web application that exposed internal corporate information to web
users with simple curiosity about your business. What impact could such a scenario
have on your business?
Without a plan or model of the web application, you are likely to miss implementing a
vital component. Depending on the version of Rose that you are using, Rose provides
tools to help you through the entire development and implementation process.
Rational Unified Process (RUP) provides a set of methodologies and a step-by-step
development approach using industry best practices. You can use RUP as a guide for
building your web application. Using the use case driven approach found in RUP, you
can compile a set of use cases to elaborate on in Rose Web Modeler.
The book Building Web Applications with UML, by Jim Conallen, is another resource
you can leverage.
When you are ready to model a web application, review and use the following topics
and procedures:

Rose Stereotypes for Web Modeling

Web Architecture

Adding Web Modeler Tools

Setting Web Modeler as the Model Language

Modeling a Web Application

Defining Relationships between Web Artifacts


Rose Stereotypes for Web Modeling
Rational Rose Web Modeler assigns the following class stereotypes to artifacts in
your N-tier web application:

Web Server Page Stereotype

Web Client Page Stereotype

Web Session Stereotype

Web Application Stereotype

Web HTML Form Stereotype

Web COM Object Stereotype

Web Applet Stereotype


Rose Web Modeler represents constraints and relationships with the following
stereotypes:

Link Relationship

Submit Relationship

Build Relationship

Redirect Relationship

Rose Web Modeler uses two dependency stereotypes:

Includes

Instantiates
Web Architecture
You can define web architecture as the thin client or N-tier infrastructure underlying
the relationships between the users client browser, your web server, files and other
resources such as databases, Java scripts, ActiveX controls, and applications used in
your enterprise. How these web artifacts interact determines whether you have a web
site or web application.
Web sites display formatted files to the clients browser using a network connection to
send a HTTP protocol request to a web server that answers the user request for
content, then renders and displays a web page on the clients browser. The typical web
page uses HTML-formatted content files, client scripts to produce the page on the
users browser, and links to other pages. When modeling your web application
categorize web search engines as web sites. Although web search engines accept user
input to select information from a database that matches the search criteria, the web
search engine does not change the state of your business logic when it returns the
result of the search to the users browser. Some web sites display page content by
selecting from information available in a database rather than from preformatted
pages. Since dynamic web page construction does not affect business logic, you
should categorize these web pages as another example of a web site.
Your companys first generation web site probably consisted of content pages that
users navigated using links to internal and external URLs. This type of web site is
usually developed and maintained by the content authors and access managed by your
system administrators. If this is your first experience developing a web application or
you must update an existing online shopping web site to perform more robust
transactions, you need to understand web architecture and modeling web artifacts. The
illustration shows a simple, first generation web site architecture.

First generation web sites do not change the status of your business. Users who
navigate to your web site request web pages of static information. A network
connection transmits users web content request using the HTTP protocol. Your web
server responds to the request for web content and delivers a web page that displays
on the users client browsers. Your underlying databases and applications do not
change as a result of this type of interaction with a web site user.
Second and third generation web applications require analysis, planning, design, and
testing since user input changes the state of your business logic with actions executed
on your web site. To implement a web application, you must work with content
authors, the system administrator, the database administrator, and other application
developers to ensure that overall web application functioning is consistent with
business rules and goals. Whether you are implementing an e-commerce web
application that updates inventory in a database when a user requests products or
business-to-business web application that facilitates a vendor supplier relationship
you should plan, model, and communicate information about your web application to
stakeholders. Stakeholders are members of your development team, management, and
the users of your web application.
Web applications are systems that allow client input to affect business logic, such as a
student online registration system that updates the course enrollment database, creates
a course roster report, adds a billing line to the students account impacting the
accounts receivable system, and makes other changes to your enterprise resources.
Web application users enter a range of data, using text boxes, check boxes, and binary
or file information. The impact of a web application to your business logic is
substantial and requires planning, analysis, design, testing and multiple iterations of
changes to be successful.
Adding Web Modeler Tools
Use this procedure to add the Web Modeler tools to the Rational Rose toolbar. Web
Modeler uses class stereotypes to represent web artifacts. This procedure changes the
default language and adds the Web Modeler tools to the Rose toolbar. After
completing this procedure, you can begin modeling your web application using a
Rose class diagram.
To prepare Rose for modeling a web application
:
1.
On the Tools menu select Options.
2.

Click the Notation tab, and then select Web Modeler from the Default
Language pull-down box.

3.

Click OK.

4.

Right-click the Rose toolbar and select Customize.

5.

Select the following tools from the Available toolbar buttons pane, and click
Add after each selection:

Create a Server Page

Create a Client Page


6.

Create a Form

Click Close.

Setting Web Modeler as the Model Language


Use this procedure to update the Rational Rose default model language to Web
Modeler. This procedure makes the Web Modeler class stereotypes available when
creating or modifying classes (web artifacts).
1.
On the Rose Tools menu, point to Options, and click the Notation tab.
2.
Select Web Modeler from the Default Language pull-down box.
3.
Click OK.
Modeling a Web Application
Use this procedure to model your web application with Rational Rose Web Modeler
stereotyped classes and relationships. The steps for adding web artifacts to a model
are the same as described in this procedure. For different web artifact types, you
choose a different stereotype type. For example, when creating COM objects, select
the stereotype COM from the class stereotype dialog.
To model a web application using the Logical View:
1.

In the Rose browser, right-click the Logical View, point to New, and click
Class.

2.

Type a name for the web artifact and press Enter.

3.

Double-click the web artifact to display the Class Specification window.

4.

Select a Web Modeler class stereotype from the Stereotype pull-down box.

5.

Click OK.

6.

On the File menu, click Save.

7.

Type the web application model name in the File Name box on the Save As
dialog box.

Note: If Class Specification window does not list Web Modeler class stereotypes in
the Stereotype pull-down box, you need to update the default language to Web
Modeler. Use the procedure, Setting Web Modeler as the Model Language.
To model a web application using the Web Modeler tools:
1.

Click the Web Modeler tool, and then click the cursor in the class diagram.

2.

Type a name in for the new class.

3.

Repeat steps 1 and 2 for each new class.

4.

On the File menu, click Save.

5.

Type the web application model name in the File Name box on the Save As
dialog box.

Note: If the Web Modeler tools are not displayed on the Rose toolbar, use the Adding
Web Modeler Tools procedure.
Defining Relationships between Web Artifacts
Use this procedure when modeling a web application in a Rational Rose class
diagram. Before using this procedure, you must create the web artifacts using the
Rose Logical View or class diagram. See the Modeling a Web Application procedure.
To define relationships between web artifacts:
1.

Drag the web artifacts to the class diagram if you used the Logical View to
create the classes.

2.

Click the association arrow, then click the first class in the relationship, drag
the arrow to the second class in the relationship, and release the cursor.

3.

Double-click the arrow to display the Association Specification window.

4.

Select the relationship type relevant to the two classes from the Stereotype
pull-down box.
For example, a server page class builds a client page. This association type is a
builds association between the server and the client. The client never builds
the server. To define this relationship, you select build from the Stereotype
pull-down box.

5.

Repeat steps 2 through 4 for each relationship in your model.


Save your model often.

Note: Some relationships between web artifacts are dependency or instantiates


relationships. Choose the dependency arrow when defining that relationship type. The
dependency arrow draws a dashed line with an arrowhead.

Vous aimerez peut-être aussi