0% found this document useful (0 votes)
10 views

UML LAB - Exp 1

Uploaded by

RaniTeetla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

UML LAB - Exp 1

Uploaded by

RaniTeetla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

UML Building Blocks

1. Things
Structural things define the static part of the model. They represent the physical and conceptual
elements. Following are the brief descriptions of the structural things.
1. Class − Class represents a set of objects having similar responsibilities.

2. Interface − Interface defines a set of operations, which specify the responsibility of a


class.

3. Collaboration −Collaboration defines an interaction between elements.

4. Use case −Use case represents a set of actions performed by a system for a specific goal.

5. Component −Component describes the physical part of a system.

6. Node − A node can be defined as a physical element that exists at run time.

7. Object - The object is an instance of a class.

8. Active Class – Used to describe concurrent behavior of the system.


Behavioral Things consists of the dynamic parts of UML models
1. Interaction − Interaction is defined as a behavior that consists of a group of messages
exchanged among elements to accomplish a specific task.

2. State machine − State machine is useful when the state of an object in its life cycle is
important. It defines the sequence of states an object goes through in response to events.
Events are external factors responsible for state change

Grouping things can be defined as a mechanism to group elements of a UML model together.
1. Package − Package is the only one grouping thing available for gathering structural and
behavioral things.

Annotational things can be defined as a mechanism to capture remarks, descriptions,


and comments of UML model elements.
1. Note - It is the only one Annotational thing available. A note is used to render comments,
constraints, etc. of an UML element.

2 Relationships
Relationship is another most important building block of UML. It shows how the elements are
associated with each other and this association describes the functionality of an application.
1. Dependency is a relationship between two things in which change in one element
also affects the other.

2. Association is basically a set of links that connects the elements of a UML model. It
also describes how many objects are taking part in that relationship.

3. Generalization can be defined as a relationship which connects a specialized element


with a generalized element. It basically describes the inheritance relationship in the
world of objects.

4. Realization can be defined as a relationship in which two elements are connected.


One element describes some responsibility, which is not implemented and the other
one implements them. This relationship exists in case of interfaces.
3 UML Diagrams

Structural Diagrams represent the static aspect of the system. These static aspects represent
those parts of a diagram, which forms the main structure and are therefore stable.

1. Class diagrams consist of classes, interfaces, associations, and collaboration.


2. Object diagrams are a set of objects and their relationship is just like class diagrams.

3. Component diagrams represent a set of components and their relationships.

4. Deployment diagrams are a set of nodes and their relationships. These nodes are
physical entities where the components are deployed.
Behavioral Diagrams basically capture the dynamic aspect of a system. Dynamic aspect can
be further described as the changing/moving parts of a system.
5. Use case Diagrams are a set of use cases, actors, and their relationships. They represent
the use case view of a system.

6. Sequence diagram deals with some sequences, which are the sequence of messages flowing
from one object to another.
7. Collaboration diagram represents the structural organization of a system and the
messages sent/received. Structural organization consists of objects and links.

8. State-chart Diagram describes the state change of a class, interface, etc. State chart diagram
is used to visualize the reaction of a system by internal/external factors.
9. Activity diagram describes the flow of control in a system. It consists of activities and links.
Case Studies
Problem Statements
1. Library Management System
 It is a support system for a library. 

 The library lends books and magazines to borrowers, who are registered in the system,
as are the books and magazines. 

 The library handles the purchase of new titles for the library. Popular titles are bought
in multiple copies. Old books and magazines are removed when they are out of date or
in poor condition. 

 The librarian is an employee of the library who interacts with the customers
(borrowers) and whose work is supported by the system. 

 A borrower can reserve a book or magazine that is not currently available in the library,
so that when it’s returned or purchased by the library, that borrower is notified. The
reservation is canceled when the borrower checks out the book or magazine or through
an explicit canceling procedure. 

 The librarian can easily create, update, and delete information about the titles,
borrowers, loans, and reservations in the system. 

 The system can run on all popular Web browser platforms (Internet Explorer 5.1+,
Netscape 4.0+, and so on). 
 The system is easy to extend with new functionality. 

2. Point-Of-Sale Terminal
 POS system is a computerized application used to record sales and handle payments; it is
typically used in a retail store. It includes hardware components such as a computer and
bar code scanner, and software to run the system. 

 It interfaces to various service applications, such as a third-party tax calculator and
inventory control. These systems must be relatively fault-tolerant; that is, even if remote
services are temporarily unavailable, they must still be capable of capturing sales and
 handling at least cash payments. 
 POS system increasingly must support multiple and varied client-side terminals and
interfaces. These include a thin-client Web browser terminal, a regular personal computer
with something like a Java Swing graphical user interface, touch screen input, wireless
 PDAs, and so forth. 
 Furthermore, we are creating a commercial POS system that we will sell to
 different clients with disparate needs in terms of business rule processing. 
 Each client will desire a unique set of logic to execute at certain predictable points in
scenarios of using the system, such as when a new sale is initiated or when a new
line item is added. Therefore, we need a mechanism to provide this flexibility and
customization. 
1. Familiarization with Rational Rose
Rational Rose is an object-oriented Unified Modeling Language (UML) software design
tool intended for visual modeling and component construction of enterprise-level software
applications. Two popular features of Rational Rose are its ability to provide iterative
development and round-trip engineering.

1. Browser
Browser contains a list of all the modeling elements in the current model. It contains a tree
view of all the elements in the current Rose model. This presents a hierarchical view of the
analysis and design model, including all the diagrams and all the individual elements that make
up a diagram.

2. Documentation Window
Documentation Window may be used to create, review, and modify any selected
modeling element. If nothing is selected, the window displays the string “No selection”. The
contents of the Documentation Window will change as different modeling elements are
selected. To add documentation, right click on the element, select specification, and fill in the
documentation field. The documentation will then be shown in the documentation window each
time the mouse is clicked on the element.
3. Diagram Windows
Diagram windows allow creating and modifying graphical views of the current model. Each
icon on a diagram represents a modeling element. This is the place where the diagram is actually
created.
4. Drawing Tools
This tool presents a set of icons that indicate the different elements that can be added to a
diagram. The elements that can be used will change, depending on the type of diagram
being created. Different diagram types have different sets of icons.

Views in Rational Rose

There are four views for a model created in Rational Rose, each representing the system
from a different point of view.

1. Use Case View


The use case view contains the diagrams used in analysis, and all the elements that contain
these diagrams. This view looks at actors and use cases along with their interactions. The
diagrams in this view are use case diagrams, sequence diagrams and collaboration diagrams. The
purpose of the use case view is to visualize what the system must do, without dealing with the
specifics of how it will be implemented.
Packages in the use case view can contain actors, use cases, sequence diagrams, and/or
collaboration diagrams. To create a package:
 Right-click on the parent modeling element (use case view or another package) to make
the shortcut menu visible. 

 Select the New: Package menu command. This will add a new package called New
 Package to the browser. 
 While the new package is still selected, enter its name. 
Once a package is created, modeling elements may be moved to the package. To move a 
modeling element to a package:
  Click to select the modeling element to be relocated. 
 Drag the modeling element to the package. 
 
2. Logical View
The logical view contains the diagrams used in object design. The diagrams in this view are
class diagrams and state transition diagrams. It offers a detailed view of how the system
visualized in the use case view will be implemented. The basic element in this view is the class,
which includes an outline of its attributes and operations. This directly corresponds to a class
created in our chosen implementation language. From the logical view, skeletal code can be
generated for implementation into a computer language. More recent versions of Rational Rose
not only can generate skeletal code for Visual C++, Visual Java, or Visual BASIC, but also
reverse engineer programs created in these languages into Rational Rose models. This allows
existing components to be included in documented models, if there is access to the source code.
In addition, changes that need to be made during implementation can be reflected in the
documentation of the design model.
3. Component View
The component view is a step up from the logical view and contains diagrams used in system
design. This view contains only component diagram. This includes information about the code
libraries, executable programs, runtime libraries, and other software components that comprise
the completed systems. Components can be pre-existing; for example, a Windows program in
Visual C++ will utilize Microsoft Foundation Class to provide the framework for the Windows
interface. Components that do not exist and need to be created by the developers will have to be
designed in the logical view.
Rose automatically creates one component diagram called Main. To create an additional
component diagram:
 Right-click on the owning package (either the component view itself or a user created
package) to make the shortcut menu visible. 

 Select the New: Component Diagram menu command. This will place a new component
 diagram called New Diagram in the browser. 
 While the new diagram is still selected, enter its name. 
Rose will automatically add the new diagram to the browser.
 To open a component diagram: 
o Double-click on the diagram in the browser.
 To create a component: 
o Click to select the package specification icon from the toolbar.
o Click on the component diagram to place the component.
o While the component is still selected, enter its name.
Rose will automatically add the new component to the browser.
 To create a dependency relationship:
o Click to select the dependency icon from the toolbar.
o Click on the package or component representing the client.
o Drag dependency arrow to the package or component representing the supplier.
4. Deployment View
The deployment view illustrates how the completed system will be physically deployed. This
view contains only deployment diagram. This view is necessary for complex applications in
which a system will have different components located on different machines. For example,
interface components may be located on a user machine while other components may be located
on a network server.
 To open the deployment diagram: 
o Double-click on the Deployment View in the browser.
 To create a node: 
o Click to select the processor icon from the toolbar.
o Click on the deployment diagram to place the node.
o While the node is still selected, enter its name.
 To create a connection: 
o Click to select the connection icon from the toolbar.
o Click on the node representing the client.
o Drag the connection line to the node representing the supplier.

You might also like