chp 2

29
7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide 1/29 www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm Chapter 2 Introducing UML OOAD is a technique for analyzing the requirements and creating the design for a software system. The analysis done using OOAD needs to be depicted in a graphical form. This method of displaying the information graphically is known as visual modeling. The visual models of a software system can be created by using Unified Modeling Language (UML). UML provides a variety of diagrams to represent the structure and design of a software system. It helps project teams to communicate, explore potential designs, and validate the architectural design of the software. This chapter discusses the need, scope, and building blocks of UML. It explains the types of UML diagrams and the various views of software systems. In addition, the chapter provides an overview of Microsoft Visio as a UML tool. Finally, it discusses the benefits, the life cycle, and the best practices of Rational Unified Process (RUP). Objectives In this chapter, you will learn to: Identify the evolution, scope, and building blocks of UML Identify the types of UML diagrams Use Microsoft Visio to create UML diagrams Identify the benefits, lifecycle, and best practices of RUP

Upload: parth-kunder

Post on 20-Jan-2016

17 views

Category:

Documents


0 download

DESCRIPTION

UML CHAP 2

TRANSCRIPT

Page 1: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

1/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Chapter 2Introducing UML

OOAD is a technique for analyzing the requirements and creating the design for a software system. Theanalysis done using OOAD needs to be depicted in a graphical form. This method of displaying theinformation graphically is known as visual modeling.

The visual models of a software system can be created by using Unified Modeling Language (UML). UMLprovides a variety of diagrams to represent the structure and design of a software system. It helps projectteams to communicate, explore potential designs, and validate the architectural design of the software.

This chapter discusses the need, scope, and building blocks of UML. It explains the types of UMLdiagrams and the various views of software systems. In addition, the chapter provides an overview ofMicrosoft Visio as a UML tool. Finally, it discusses the benefits, the life cycle, and the best practices ofRational Unified Process (RUP).

Objectives

In this chapter, you will learn to:

Identify the evolution, scope, and building blocks of UML

Identify the types of UML diagrams

Use Microsoft Visio to create UML diagrams

Identify the benefits, lifecycle, and best practices of RUP

Page 2: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

2/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Overview of UML

Consider an architect who has acquired a contract of a building. The architect needs to work out theblueprint of the building on paper and get it approved from the client before the construction of the buildingactually begins. The same analogy applies to software systems. You need to create a blueprint that depictsthe structure and design of the software system before the development of the software system begins.

At the onset, if you model the blueprint of the software system, it prevents the occurrence of any designfaults. This reduces the rework and development time of the system in the later phases of SDLC.

UML is a standard language for creating blueprints that depict the structure and design of the softwaresystem. You can use UML for modeling systems that can range between enterprise information systems todistributed Web-based applications. UML is a notational language that enables the stakeholders to view thearchitecture of the system from various perspectives.

There are several tools available, such as Rational Rose, Jude, AgroUML, Visio and Poseidon, which youcan use to design software systems by using UML.

Evolution of UML

The evolution of UML began with the need for a modeling language in which you can develop models ofobject-oriented software systems. During the mid 1970s and late 1980s, object-oriented modelinglanguages were developed for the analysis and design of software. Of these modeling languages, the mostprominently used languages were Booch's Booch’93, Jacobson's Object Oriented Software Engineering(OOSE), and Rumbaugh's Object Modeling Technique-2 (OMT). Each of these languages was completein itself and was recognized as having certain strengths and weaknesses. For example, Booch’93 wasefficient in projecting the software system during the design and construction phases of the projects. OOSEwas more helpful in the requirements capturing and analysis phases. OMT was used for the analysis ofdata-intensive information systems.

Because several modeling languages were being used in the industry, there was a need for a standardlanguage for modeling. In October 1994, Grady Booch, Ivor Jacobson, and Jim Rumbaugh of RationalSoftware Corporation began the unification of Booch’93, OMT, and OOSE. They developed a unifiedlanguage and released version 0.9 and 0.91 of UML.

To standardize UML, Object Management Group (OMG), a non-profit organization for standardizingspecifications, issued a Request for Proposal (RFP) in 1996. In response to the RFP issued by OMG, aUML consortium was established with the support of major software organizations such as HP, I-Logix,IBM, Microsoft, Oracle, Rational Software, and Unisys. The UML consortium prepared and presented therevised version of UML 1.1 to OMG. Finally, OMG accepted UML as a standard modeling language andtook over the responsibility for overseeing the maintenance of UML. Many versions of UML were releasedwith more additions and modifications. This course discusses UML 2.0.

Scope of UML

Page 3: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

3/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Rational Software Corporation, which has now been acquired by IBM, defines UML as: “The UML is alanguage for specifying, constructing, visualizing, and documenting the artifacts of a software-intensivesystem.” The artifacts might include requirements, architecture, design in terms of classes, objects orinterfaces, source code, tests, prototypes, and the software releases of a software system.

For a better understanding, you can further divide the definition of UML into the following subparts:

UML is a language for specifying artifacts: This means that UML provides the notationsfor classes, objects, and interfaces, which enable the development team to define the scopeand content of a software system.UML is a language for visualizing artifacts: This means that UML allows you to creatediagrams to visualize a software system. Creating diagrams provides a better understanding ofthe structure and content of the software system. For example, a diagram depicts thehierarchical arrangement of classes more clearly than code. Another benefit is that even if thecode is lost, the logical structure of the system remains intact in the form of diagrams. The useof predefined notations for developing diagrams enables one development team to interpret themodels created by other teams.UML is a language for constructing artifacts: This means that UML allows codegeneration from a UML model. Generating code from a UML model is called forwardengineering. In addition, UML enables reverse engineering, which means it allows you toreconstruct a model from code.UML is a language for documenting artifacts: This means that you can use the diagrams asinput documents for the subsequent phases of SDLC.

Building Blocks of UML

The building blocks of UML include the components that are necessary for creating models of the softwaresystems. The three types of UML building blocks are:

Basic UML constituents: Include the static, dynamic, grouping, and annotational constituentsof UML.Relationships: Depict the relations between the various constituents of a UML model.Diagrams: Represent the various artifacts of a system graphically. Diagrams enable you tovisualize a system from all the aspects of software development.

To understand the basic UML constituents, let us revisit the analogy of constructing a building. You requirebricks, sand, cement, plastic, and iron bars as the base constituents to begin the construction of a building.These constituents do not change when you are giving shape to the building. Similarly, to begin the design ofa software system, you need to identify classes, interfaces, objects, use cases, collaborations, components,and nodes. These form the static constituents of the software system because they do not change evenwhile you identify the interactions or change of state of these constituents.

Again going back to the analogy of the building, you need to identify which door leads to which room andwhich window is opening in which direction. This will give a shape to the building. You may also refer to itas the behavior of the building. Similarly, the static constituents, such as classes, need to interact to depicttheir response to the other objects and classes. You can depict such responses and relations betweenclasses by using messages at the design phase. Messages and states form the dynamic constituents of thesoftware system.

MRuser
Highlight
MRuser
Highlight
Page 4: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

4/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

The walls, doors, windows, ceiling, and floor make up a room of the building. Going into more detail, therooms, kitchen, and wash rooms form the complete apartment. Similarly, the classes and interfaces need tobe grouped in packages, which in turn, can be grouped together to form a complete software system. Apackage is the grouping constituent used in UML.

Each apartment in the building has an owner and a name plate of its owner. Similarly, to provide moreexplanation on each structural or grouping constituent, such as classes and packages, you should provide anexplanation on the role of each constituent in the model. The UML annotational constituent, note, providesan explanation on the structural, behavioral, and grouping constituents.

Page 5: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

5/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Identifying the Types of UML Diagrams

UML provides the following thirteen diagrams to represent the structure and design of a software system:

Use case diagramsClass diagramsObject diagramsCommunication diagramsSequence diagramsState Machine diagramsActivity diagramsPackage diagramsComponent diagramsDeployment diagramsTiming diagramsComposite Structure DiagramsInteraction Overview Diagrams

UML diagrams use various notations to specify the syntax of the constructs used forcreating the diagrams. For example, UML notations specify how to depict the useror the classes and interfaces of the system.

Defining Use Case Diagrams

A use case diagram depicts the various operations that a system performs. It contains use cases, actors,and their relationships. Use cases are the sequence of actions that form a single unit of work for an actor.An actor represents a user who is external to the system and interacts with the use case.

The following figure depicts the graphical notation for a use case diagram.

A use case diagram can be drawn for any given software system. For example, in an order processing

MRuser
Highlight
Page 6: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

6/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

system, the inventory department places a request for the machine parts that are out of stock. In this case,the inventory department is an actor that uses the system to place an order for the parts. Similarly, theinventory department also receives the supply to update the stocks. The use cases for the actor,Inventory Department, are Order Parts and Accept Supply. The following figure

shows the use case diagram for the order processing system.

Defining Class Diagrams

A class diagram represents a set of classes, interfaces, and their relationships. You can represent a class

in a rectangular box with three compartments. The first compartment shows the class name. The secondcompartment shows the attributes of the class and the third compartment shows the methods associatedwith the class.

The following figure shows the graphical notation for classes along with their attributes, methods, andrelationships.

You can draw a class diagram by identifying the classes in the system. For example, the classes identified inthe order processing system are Supplier and Parts. The various attributes of the Supplierclass are scode, name, and city, and the methods of the Supplier class are supply() and

receivepayment(). The various attributes for the Parts class are pcode, name,

qty_ordered, qty_received, and qty_rejected, and the methods of the Parts class

are order(), received(), and updateinventory(). The following figure shows the class

MRuser
Highlight
Page 7: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

7/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

diagram for the order processing system.

Defining Object Diagrams

An object diagram represents instances of a class diagram. You represent an object in a rectangular

box with two compartments. The object name appears before the class name in the first compartment. Thesecond compartment shows the attributes of the objects. The following figure shows the graphical notationfor objects along with their attributes and relationships.

You can draw an object diagram by identifying the classes in the system. The following figure shows the

object diagram for the order processing system.

Defining Communication Diagrams

Communication diagrams represent an interaction between objects in the form of messages. For example,the following figure depicts the interaction between the Inventory Department and an object of

the supplier class of the order processing system.

MRuser
Highlight
MRuser
Highlight
Page 8: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

8/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Communication diagrams are also called as collaboration diagrams.

Defining Sequence Diagrams

Sequence diagrams represent an interaction between objects in the form of messages ordered in asequence by time. The difference between the sequence and communication diagrams is thatcommunication diagrams emphasize on the structural organization of objects as opposed to sequencediagrams that show the messages exchanged between objects ordered in a sequence by time.

You can draw a sequence diagram for any given system by using the classes and use cases identified for thesystem. The following diagram shows the sequence of messages in the order processing system.

In the order processing system, the Inventory Department places the order with the

MRuser
Highlight
Page 9: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

9/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

supplier, supp1. The supplier, supp1, supplies these parts to the Inventory

Department.

Defining State Machine Diagrams

A state machine diagram shows how a class reacts when an event occurs. You can draw a state machinediagram by using the classes and the use cases identified for the system. For example, in the orderprocessing system, the Parts class has an attribute, re-order. An order is placed when the stock

reaches a particular level. In this case, the re-order attribute is set to true. After the supplier supplies

the parts, the re-order level is changed to false.

The following figure shows the state diagram for the Parts object in an order processing system.

A state machine diagram is also called as a state diagram or a state chart diagram.

Defining Activity Diagrams

Activities are a representation of the various operations performed by a class. An activity diagram depictsthe flow of control from one activity to another.

You can draw an activity diagram by identifying the activities performed by the various classes of thesystem. For example, the various activities in the order processing system are_placing order,

accepting tenders, and receiving supply.

The following figure shows the flow of the activities for the order processing system.

Page 10: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

10/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Defining Package Diagrams

All the interrelated classes and interfaces of the system when grouped together form a package. Torepresent all these interrelated classes and interfaces UML provides package diagrams. Package diagramshelp in representing the various packages of a software system and the dependencies between them. It alsogives a high-level impression of use case and class diagrams.

A package is depicted, as shown in the following figure.

Page 11: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

11/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Defining Component Diagrams

You combine packages or individual entities to form components. You can depict various components andtheir dependencies using a component diagram. The following figure shows the graphical notation forrepresenting a component.

To understand how a component diagram depicts the components and their dependencies, consider anexample of the orderprocess executable component that regulates the order and supply

procedure. The orderprocess executable component depends on the order.cs file for placing an

order for the machine parts. Similarly, the orderprocess executable component depends on the

processupply.cs file for processing the supply received.

The following diagram shows the component diagram for the order processing system.

Page 12: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

12/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Defining Deployment Diagrams

A deployment diagram shows the physical placement of components in nodes over a network. Adeployment diagram can be drawn by identifying nodes and components. For example, in the orderprocessing system, the orderprocess.exe component is placed on the Client node and the

database component is placed on the Database Server node. The request for the data for the orderprocessing system is routed to the Database Server through the Processor Server.

The following diagram shows the deployment diagram for the order processing system.

Defining Timing Diagrams

Timing diagrams are used to represent the changes in state and value of one or more objects over a periodof time. Timing diagrams are often used to design embedded software.

Timing diagrams are of two types:

Concise notationRobust notation

Concise Notation

Page 13: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

13/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

In the concise notation, a value lifeline is used to represents the changes in the value of objects over aperiod of time. The time elapsed is represented on the X-axis and the value is shown between the pair ofhorizontal lines which cross over at each change in value. The following timing diagram depicts the valuelifeline of a printer.

Robust Notation

In the robust notation, a state lifeline is used to represent the changes in state of objects over a period oftime. The X-axis represents the time elapsed and the Y-axis depicts a set of states. The following figuredepicts the state lifeline for a printer.

State lifelines of two or more objects can be stacked on top of each other. The lifelines stacked in thismanner must have the same X-axis. Messages can be passed between the lifelines. Each state transition isassociated with a defined event or a time constraint, which indicates when an event must occur. In addition,each state may be associated with a duration constraint, which indicates how long the object remains in thatstate.

The following timing diagram depicts the state lifelines of a printer and a PC.

MRuser
Highlight
MRuser
Highlight
Page 14: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

14/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Defining Composite Structure Diagrams

A composite structure diagram represents the internal structure and interaction points of a classifier.Classifier refers to classes, objects, or interfaces. Interaction points refer to the points within a classifierusing which the classifier interacts with other parts of the system.

Composite structure diagrams are used to explore run-time instances of interconnected classifierscollaborating over communications links. A composite structure diagram is made up of several elements,such as parts, ports, and interfaces.

A part is an element that represents a set of one or more instances owned by the containing classifierinstance. You depict a part as a rectangle contained within the body of a class or component element. Thefollowing figure shows parts of the Car class connected through.

Page 15: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

15/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

A port is an interaction point between a classifier instance and its environment or between the behavior ofthe classifier and its internal parts. A classifier can have multiple ports to show different interactions. Youdepict a port as a small, named square on the boundary of the owning classifier.

A port can interact in both directions. Therefore, a port can be used to specify the services provided by aclassifier to its environment and the services required by the classifier from its environment. The servicesprovided and required by a classifier are represented as interfaces owned by the classifier. A providedinterface is represented as a ball on a stick and a required interface is represented as a socket on a stick.

The following figure depicts a port on the Engine class with provided and required interfaces.

Defining Interaction Overview Diagrams

Interaction overview diagrams give an overview of interaction diagrams. Interaction diagrams include thefollowing types of diagrams:

Sequence diagramCommunication diagramTiming diagramInteraction overview diagram

Interaction overview diagrams represent the logical interaction between the interaction diagrams and theprocess flows in between the set of interaction diagrams.

Page 16: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

16/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Interaction overview diagrams are a variant of activity diagrams. As a result, most of the diagram notationused for interaction overview diagrams is similar to the diagram notation used for activity diagrams.However, instead of activity elements, interaction overview diagrams use one of the following elements:

Interaction elementsInteraction occurrence elements

Interaction elements display an inline interaction diagram, which can be a sequence diagram, communicationdiagram, timing diagram, or interaction overview diagram. Interaction occurrence elements are references toan existing interaction diagram.

Interaction occurrence elements are visually represented by a frame, with “ref” in the frame's title space.The diagram name is indicated in the frame contents.

The following figure depicts the interaction overview diagram for an inventory management system.

Associating UML Diagrams with UML Modeling Techniques

Page 17: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

17/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

You can divide all the UML diagrams into four modeling techniques:

Requirements modeling: Involves depicting the requirements using use case diagrams.Static modeling: Involves depicting the static constituents of the software system using theclass, object, and composite structure diagrams.Dynamic modeling: Involves depicting the behavior of static constituents using the followingdiagrams:

Activity diagramsState machine diagramsCommunication diagramsSequence diagramsInteraction overview diagramsTiming diagrams

Architectural modeling: Involves depicting the architecture of the software system intomultiple tiers, such as presentation, business, and resource. Architectural modeling depicts thearchitecture of the software system by using the following diagrams:

Package diagramComponent diagramDeployment diagram

Just a minute:Which of the following UML diagrams is used for requirement modeling?

1. Use Case diagram

2. Class and Object diagram

3. State diagram

4. Component diagram

Answer:1. Use Case diagram

Viewing a Software System Architecture

You can define the architecture of a software system as an arrangement of the static and dynamicconstituents in a model. You can view the architecture of a software system from different perspectives.You need to do this because it helps the stakeholders of the system to make decisions about the project.The stakeholders may include analysts, architects, developers, testers, and end users.

The various views of a software system are:

Use case view: Indicates the functionalities that the system offers to each stakeholder. You

MRuser
Highlight
Page 18: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

18/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

can depict this view by using the use case, sequence, communication, state, activity, andinteraction overview diagrams.

Design view: Focuses on the static and dynamic representation of the system. Thestakeholders’ primary interest in viewing the system from the design perspective is to ensurethat all the primary requirements of the system are implemented. For example:

Analysts, who design the software solution, use this view to know if all therequirements are fulfilled in terms of static and dynamic constituents.Developers use the design view to verify whether or not all the static and dynamicconstituents enable them to code the software solution.Project managers use this view to prepare project plans in terms of the number ofcomponents involved in the project and to estimate the time required to codeeach component.

You can depict the design view using class, object, sequence, communication, state, compositestructure, interaction overview, and activity diagrams.

Process view: Represents the various processes executing in a system at a given instance oftime. The primary focus of this view is to evaluate the execution of processes in terms ofperformance and scalability. The process view is again important for analysts, architects, andend users to view the information flow during process execution and how data is modifiedwhile processing. You can depict this view by using the class, object, sequence,communication, state, timing, interaction overview, and activity diagrams.Implementation view: Represents the physical system including the files and componentsrequired to assemble the system. This view focuses on various methods of assembling andconfiguring the components to release the required software system. This view is important forthe client and project managers in terms of the plans for the release. It is important fordevelopers and testers to know about the final components that need to be assembled for thesystem. You can depict this view by using the component, sequence, communication, state,composite structure, timing, and activity diagrams.Deployment view: Represents the hardware components on which the software system willexecute. This view is important to the client and developers because it enables them to identifythe hardware and network configuration required to install the software system. You can depictthis view by using the deployment diagrams.

The following figure shows the multiple views that together represent the model of a software systemdesigned using UML.

Each of the five views are interlinked. For example, the deployment view includes the classes, interfaces,

Page 19: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

19/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

and collaborations of the design view. In addition, the use case view is placed in the center because it isused to capture and represent the system requirements from the perspective of other views.

Just a minute:Which of the following views of a software system focuses on the static anddynamic representation of the system?

1. Use Case view

2. Deployment view

3. Design view

4. Implementation view

Answer:3. Design view

Identifying the Role of UML in SDLC

The diagrams developed using UML serve as key documents in each phase of SDLC. In addition, you canuse UML to develop software systems based on any SDLC model. For example, you can use UML todesign a software system that follows the linear, prototyping, or iterative approach to system modeling.

You can map each of the UML diagrams with the various phases of SDLC. The requirement analysis phaseof SDLC involves identifying the end users’ expectations from a software system.

The following table lists the UML diagrams that can be used in the requirement analysis phase.

Diagram Role in the Requirements Analysis Phase

Use case Depicts the various users of the system and how they are going to use thesystem to meet the requirement objectives.

Class Depicts the classes and their dependencies for the primary requirements ofthe system.

Sequence and

Communication

Depicts the sequence of steps performed in a process.

Activity Depicts the specific activities that are required to understand the functionalrequirements of the system.

Interaction

Overview

Depicts how the various processes interact with each other.

UML Diagrams and their Role in the Requirement Analysis Phase

MRuser
Highlight
Page 20: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

20/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

In the design phase, the analysts and architects can be more specific in depicting the details of the systemthrough the UML diagrams. The following table lists various UML diagrams that you can use in the designphase.

Diagram Role in the Design Phase

Class Depicts the classes, their attributes and operations, and the relationshipbetween classes.

Sequence and

Communication

Depicts the sequence of interactions between the various objects of the

system.

Package Depicts the various classes that are grouped together depending on theirfunctionality.

Deployment Depicts the layout of the software components over the network.

State Depicts the state of an object on the occurrence of an event.

Component Depicts the components required for executing the system.

CompositeStructure

Depicts the internal structure and interaction points of the various classes,objects, and interfaces.

Interaction

Overview

Depicts the interactions between the various interaction diagrams.

UML Diagrams and their Role in the Design Phase

In the testing phase, you test the system to detect whether the software system works according to therequirements. You use the use case diagram in the test phase to check whether the system meets therequirements specified in the use case diagrams.

MRuser
Highlight
Page 21: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

21/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Introducing Visio as a UML Tool

Visio is a Microsoft tool that facilitates object-oriented design using UML. This tool runs efficiently onWindows XP, Windows 2000, Windows NT, and Mac operating systems. It helps to create UMLdiagrams. It also helps in generating C#, C++, or Visual Basic code for the UML diagrams.

Using Visio to Create UML Diagrams

To create a simple use case diagram using Visio, you need to perform the following steps:

1. Select Start→All Programs→Microsoft Office→Microsoft Office Visio forEnterprise Architects. The Microsoft Visio window appears.

2. Select File→New→Choose Drawing Type. The Choose Drawing Type windowappears, as shown in the following figure.

3. Click Software from Category section in the Choose Drawing Type window. All thetemplates will appear in the Template section, as shown in the following figure.

Page 22: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

22/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

4. Select UML Model Diagram (Metric) from the list of templates. The Drawing1-Microsoft Visio window with a blank drawing page appears, as shown in the followingfigure.

The stencils contain the shapes you need to create your diagrams.

Page 23: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

23/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

The English-language version of Microsoft Office Visio comes with twosets of templates: those that use US units and those that use metric units.US units are the units used in the US measurement system, such asinches, feet, yards, and miles.

If you want to create some drawings that use metric and some that useUS units, you need to install both sets of templates. You can choosewhich units you want to use when you start a new drawing.

5. Select the UML Use Case (Metric) stencil in the Shapes window to view the shapes itcontains, as shown in the following figure.

6. Drag the Actor symbol ( ) on the drawing page from the UML Use Case (Metric)stencil, to draw an actor.

7. Drag the Use case symbol ( ) on the drawing page from the UML Use Case (Metric)stencil, to draw a use case.

8. Drag the Communication symbol ( ) on the drawing page from the UML Use Case(Metric) stencil, to represent the interaction between the actor and the use case. Drag oneend of the Communication symbol and drop it on a cross symbol known as ConnectionPoint on the actor so that one end of the Communication symbol gets connected to the

Page 24: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

24/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

actor. Now drag the other end of the Communication symbol and drop it on the use case.

Actor and use case need to be connected through an association. In Visio anassociation is represented by using the Communication symbol.

This connects the actor with the use case to create a simple use case diagram, as shown in the followingfigure.

The cross symbols on a shape represent the connection points. Two symbols willconnect with each other only if they are connected at these connection points. If theconnection points are not visible, select View→Connection Points to makeconnection points visible with each symbol on the drawing page. If you do not wantto view the connection points, you can hide them by again selectingView→Connection Points.

Page 25: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

25/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Page 26: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

26/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Identifying Rational Unified Process (RUP)

RUP is a software development methodology developed by Rational Software Corporation, which is nowa division of IBM. It is a process framework that helps you create and deploy software designed usingOOAD. RUP provides templates, examples, and tools that act as mentors for all the activities performed inthe different phases of the software development process. It includes a hyperlinked knowledge base withsample artifacts and detailed descriptions for many different types of activities. Using RUP, thedevelopment team has a common knowledge base, language, process, and view on how to develop thesoftware.

RUP is completely compatible with UML and is integrated with the Rational suite of software developmenttools. RUP is included in the IBM Rational Method Composer (RMC) product, which allowscustomization of the process. RUP utilizes Rational tools to generate development components, such asdocuments, manuals, and code.

Benefits of Using RUP

RUP is a process that helps manage the quality and risks in a software project. The benefits of using RUPare:

Provides team members with easy access to a knowledge base and, as a result, enhances teamproductivity.Provides a guideline on how to effectively use UML.Supports the tools that automate large parts of the development process.Supports the iterative process for software development. This allows you to identify andresolve the risks in a software project that are identified during the various iterations of thesoftware development process.Supports an architecture-centric development process. In addition, RUP focuses on the earlydevelopment of software architecture, which facilitates parallel development, minimizes rework,and increases the probability of component reuse and eventual system maintainability.Allows customization of the process. This means that RUP can be tailored to the needs ofsmall development teams as well as large development organizations.Allows you to systematically control the changes in the software during the development lifecycle.Allows you to execute test cases.

Life Cycle of RUP

RUP defines the following four phases of the life cycle of a project:

Inception: Includes establishing the business model and the scope for the project. In addition,it also involves planning for the type of development process model.Elaboration: Includes analyzing the problem domain, developing project plan, and eliminatinghighest possible risks. This phase also includes development of architectural plan after theanalysis of the entire system is complete. In addition, the phase includes implementing use cases

Page 27: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

27/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

to demonstrate the architecture of the software system.Construction: Includes developing software product iteratively and incrementally. At the endof iteration, the product is released for customer evaluation. The activities of the phase includedesign, implementation, and testing of the software.Transition: Includes deploying software at the customer site. This phase also includesmaintaining the software if faults or errors occur in the software after its deployment.

Business modeling describes the working of the existing processes of theorganization and the role of each person involved in the process.

RUP Best Practices

RUP has defined the following six best practices that you should follow in the software developmentprocess:

Develop software iterativelyManage requirements effectivelyUse a component-based development approachVisually model the softwareVerify the software qualityControl any changes to the software

Just a minute:Which of the following phases of RUP includes analyzing the problemdomain, developing project plan, and eliminating highest possible risks?

1. Inception

2. Elaboration

3. Construction

4. Transition

Answer:2. Elaboration

Page 28: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

28/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Summary

In this chapter, you learned that:

UML is a standard language for creating blueprints that depict the structure and design of thesoftware system. It is used to specify, visualize, construct, and document the artifacts of asoftware system.The building blocks of UML consist of basic constituents, relationships, and diagrams. Thebasic constituents include the structural, behavioral, grouping, and annotational constituents.UML diagrams enable you to visualize the software system by graphical representation of thevarious constituents.The thirteen UML diagrams are use case, class, object, communication, sequence, statemachine, activity, package, component, deployment, timing, composite structure, andInteraction overview.The architecture of a software system can be viewed from the different perspectives of thestakeholders.UML diagrams are used in the analysis and design phases of SDLC.Visio is a tool that can be used to draw UML diagrams.RUP is a software development methodology developed by Rationale Software Corporation,which is now a division of IBM. It is a process framework that helps you to create and deploysoftware designed using UML.

Exercises

Exercise 1

Technology Systems Inc. decided to create a new computer to provide simulation environment fordeveloping real-time systems. Technology System Inc. would require advanced hardware and operatingsystem to manufacture the new computer. System programs, which provide the interface between theoperating system and the hardware, also need to be developed.

The company has experienced Java programmers and, therefore, it decides to write the system programs inJava. The Project Manager is aware of the limitations of Java in system programming. The programmingteam identifies some of the additional features or extensions that need to be embedded in the existing Javacompiler for system programming. It is also known that requirements can evolve during the developmentphase of the project.

Other team members are also developing software for the new computer and need the Java compiler tocompile the software. Most of these software requirements require few extensions in the Java language torun on a new Operating System. Identify the approach to be used to create the computer.

Page 29: Chp 2

7/21/12 Object-Oriented Analysis and Design Using UML: Student Guide

29/29www.niitstudent.com/india/Content/063OUML1S1/OEBPS/08_ch02.htm

Reference Links

Overview of UML

Reference Reading: Books Reference Reading: URLs

The Unified ModelingLanguage Reference

Manual by Grady BoochJames RumBaugh IvarJacobson Publisher:Pearson Education

http://www-106.ibm.com/developerworks/rational/library/998.html

Identifying the Types of UML Diagrams

Reference Reading: Books Reference Reading: URLs

The Unified ModelingLanguage User Guide by

Grady Booch JamesRumBaugh Ivar JacobsonPublisher: Addison Wesley

http://www-106.ibm.com/developerworks/rational/library/998.html