0% found this document useful (0 votes)
10 views107 pages

The Final Uml

Uploaded by

ujjwalbhujel333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views107 pages

The Final Uml

Uploaded by

ujjwalbhujel333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 107

Overview

OOA/OOD?? UML??

Specify, Visualize, Construct and Document Software


Artifacts!!!

Saroj Shakya, OOSE, Nepal College of


06/26/24 1
Information Technology
Analysis and Design

Owning a hammer does not make one an architect


Knowing Java is a necessary but insufficient step to create object systems
Knowing how to think in objects is critical

Difference between Analysis and Design


Analysis:
Investigation of the problem domain and requirements rather than a solution
e.g. an Online trading system: how will it be used? What are its functions?
Design:
Conceptual solution for fulfilling requirements rather than its implementation
Obvious details are excluded

Saroj Shakya, OOSE, Nepal College of


06/26/24 2
Information Technology
Structured Analysis and Design

Structured Analysis
Systems development life cycle (SDLC)
Predictive approach
Uses a set of process models to describe a system graphically
Process-centered technique
Waterfall model

Structured Design
methods for analyzing and converting business r
requirements into specifications

Saroj Shakya, OOSE, Nepal College of


06/26/24 3
Information Technology
Object-oriented Analysis and Design

UML: a standard diagramming notations

OOA: Emphasis on finding and describing objects or concepts in problem domain.


For example, in the case of the library information system, some of the concepts
include Book, Library, and Patron. WHAT??

OOD: Emphasis on defining software objects and how they collaborate to fulfill the
requirements.
For example, in the library system, a Book software object may have a title attribute
and a getChapter method . HOW??

Finally, during implementation or object-oriented programming, design objects


are implemented, such as a Book class in Java.

Saroj Shakya, OOSE, Nepal College of


06/26/24 4
Information Technology
College management system

This system holds the details of every student and tutor in the
college. In addition, the system also stores information about the
courses available at the college, and tracks which student is
following which courses.
A possible functional design would be to write the following
functions:
add_student
enter_for_exam
check_exam_marks
issue_certificate
expel_student

Saroj Shakya, OOSE, Nepal College of


06/26/24 5
Information Technology
The UML

Saroj Shakya, OOSE, Nepal College of


06/26/24 6
Information Technology
Object Oriented System Development

Object Oriented Software Development life cycle consists of three


macro processes:
Object Oriented Analysis
Object Oriented Design
Object Oriented Implementation

Saroj Shakya, OOSE, Nepal College of


06/26/24 7
Information Technology
Object-oriented Analysis and Design

Book
Domain concept Visualization of
title Domain Concept

public class Book{


Representation
in an Object pivate String title;
Oriented public chapter getChapter(int){
Programming
Language }

Saroj Shakya, OOSE, Nepal College of


06/26/24 8
Information Technology
Describing vs Defining

Define Use Case


OOA: deals with describing and finding objects in the problem
domain e.g. In case of Flight Information System domain objects
are plane, flight, pilot
Define Domain
OOD: deals with defining software objects and how they collaborate Model
to achieve the goal of the system
e.g. In case of Flight Information System plane object has
Define
filghtNumber attribute, getFilghtHisory ethod interaction
Diagrams

Define Design
Class Diagrams

Saroj Shakya, OOSE, Nepal College of


06/26/24 9
Information Technology
Step 1: Define Use Cases

Define Use Case


Requirements analysis may include a description of related domain
processes written as use cases.
Like written stories.
Define Domain
Model
Play a Dice Game use case:
Play a Dice Game: A player picks up and rolls the dice. If the
dice face value total seven, they win; otherwise, they lose. Define
interaction
Diagrams

Define Design
Class Diagrams

Saroj Shakya, OOSE, Nepal College of


06/26/24 10
Information Technology
Step 2: Define a Domain Model
Object-oriented analysis is concerned with creating a description of
the domain from the perspective of classification by objects.
Define Use Case
It is a visualization of concepts in the real-world domain.

A decomposition of the domain involves an identification of the Define Domain


concepts, attributes, and associations Model

A set of diagrams that show domain concepts or objects.


Define
Illustrates Player, Die, and DiceGame, with associations and attributes. interaction
Diagrams

Player 1 Rolls 2 Die


name faceValue Define Design
Class Diagrams
1 2
Plays
1
DiceGame 1 includes

Saroj Shakya, OOSE, Nepal College of


06/26/24 11
Information Technology
Step 3: Define Interaction Diagrams
Object-oriented design is concerned with defining software objects
and their collaborations. Define Use Case

Interaction diagram shows the flow of messages between software


objects, and thus the invocation of methods.
Define Domain
Model
For example, assume that a software implementation of the dice
game is desired. The interaction diagram illustrates the essential step
of playing, by sending messages to instances of the DiceGame and Die Define
classes. interaction
Diagrams
:DiceGame die1:Die die2:Die
play( ) Define Design
roll( )
Class Diagrams
fv1:= getFaceValue ( )

roll( )

fv2:= getFaceValue ( )

Saroj Shakya, OOSE, Nepal College of


06/26/24 12
Information Technology
Step 4: Define Design Class Diagrams
Interaction diagrams show dynamic view of collaborating objects,
static view of the class definitions are shown with a design class
diagram. Define Use Case

This illustrates the attributes and methods of the classes.


Define Domain
In the dice game, an inspection of the interaction diagram leads to Model
the partial design class diagram. Since a play message is sent to a
DiceGame object, the DiceGame class requires a play method, while
class Die requires a roll and getFaceValue method. Define
interaction
Diagrams
Domain model illustrates real world concepts but this diagram
shows software classes.
Define Design
DiceGame Die Class Diagrams
die1: Die die1: Die int
faceValue:
1 2 faceValue:int
die2: Die
getFaceValue
+play() ():int
roll()
Saroj Shakya, OOSE, Nepal College of
06/26/24 13
Information Technology
Cake Store
Bake cake
Heat oven
Mix flour/egg/sugar/milk
Place in oven
Store cake
Start cooler
Place cake in cool place
Sell cake
Get order from customer
Pack cake ordered by customer
Accept payment
What happens in a Cake Store??
Tender cash return
purchase Stock
Note items below reserve level
Calculate quantity to order
Place order
Store arrived materials
Chef
Receptionist
Actors??
Manager
Wholesaler
Customer
Saroj Shakya, OOSE, Nepal College of
06/26/24 14
Information Technology
Cake Store

Bake cake
Heat oven
Mix flour/egg/sugar/milk
Place in oven
Store cake
Start cooler
Place cake in cool place
Sell cake
Get order from customer
Pack cake ordered by customer
Accept payment
Tender cash return
purchase Stock
Note items below reserve level
Calculate quantity to order
Place order
Store arrived materials
Cher

Saroj Shakya, OOSE, Nepal College of


06/26/24 15
Information Technology
ATM MACHINE

We need to build the ATM system to allow a user to withdraw money.


Series of common interactions in this scenario:
‧ enter card ‧ enter pin number ‧ select amount required
‧ confirm amount required ‧ remove card ‧ take receipt
Should each of these steps . for example, .enter pin number. be a use case?

A Use Case should satisfy a goal for the actor

Is take receipt. the Well, not really. It wouldn’t be


goal for our the end of the world if the receipt
customer? wasn.’t dispensed.

Apply the rule to the other Use Cases, and you.ll find that really, none of them
describe the goal of the user.
The goal of the user is to withdraw money, and that should be the use case!
16
ATM MACHINE

We need to build the ATM system to allow a user to withdraw money. We might
have the following series of common interactions in this scenario:
‧ enter card ‧ enter pin number ‧ select amount required
‧ confirm amount required ‧ remove card ‧ take receipt
Should each of these steps . for example, .enter pin number. be a use case?

A Use Case should satisfy a goal for the actor

Is take receipt. the


goal for our
customer?
Wrong!!!!!!

Apply the rule to the other Use Cases, and you.ll find that really, none of them
describe the goal of the user.
The goal of the user is to withdraw money, and that should be the use case!
17
ATM MACHINE

We need to build the ATM system to allow a user to withdraw money. We might
have the following series of common interactions in this scenario:
‧ enter card ‧ enter pin number ‧ select amount required
‧ confirm amount required ‧ remove card ‧ take receipt
Should each of these steps . for example, .enter pin number. be a use case?

A Use Case should satisfy a goal for the actor

Is take receipt. the


goal for our
customer?

Apply the rule to the other Use Cases, and you.ll find that really, none of them
describe the goal of the user.
The goal of the user is to withdraw money, and that should be the use case!
18
Video Shop

Any one who wishes to rent a video from the shop must first be registered as a
member. Members may rent out videos provided that they are old enough, for this
reason the Sales Assistant needs to record each member’s date of birth when they
join. It also records each member’s address and phone number, so that they can
trace them in the event of a video not being returned.
Members can reserve a video provided a copy is available for the day they require it
and that they are genuine members. All video reservations are recorded in the
company’s video database so that the status of each copy can be monitored.
Reserved videos must be collected before 7pm.
To rent a video, members must present their Membership Card. Each video attracts
a rental charge depending on its popularity and how recently it has been released.
All Video rented out must be returned by 6pm the following day otherwise members
will be charged an extra day.
Staff need to update stock records with new titles or extra copies when deliveries
are received from Suppliers and deleting records of copies which are lost or
damaged on return.

19
Video Shop

Any one who wishes to rent a video from the shop must first be registered as a
member. Members may rent out videos provided that they are old enough, for this
reason the Sales Assistant needs to record each member’s date of birth when they
join. It also records each member’s address and phone number, so that they can
trace them in the event of a video not being returned.
Members can reserve a video provided a copy is available for the day they
require it and that they are genuine members. All video reservations are recorded in
the company’s video database so that the status of each copy can be monitored.
Reserved videos must be collected before 7pm.
To rent a video, members must present their Membership Card. Each video
attracts a rental charge depending on its popularity and how recently it has been
released. All Video rented out must be returned by 6pm the following day otherwise
members will be charged an extra day.
Staff need to update stock records with new titles or extra copies when
deliveries are received from Suppliers and deleting records of copies which are lost
or damaged on return.

20
The UML

"UML is a language used to specify, visualize and document the artifacts of an


object-oriented system under development.

It represents the unification of the Booch, OMT, and Objectory notations, as


well as the best ideas from a number of other methodologists

Provides the basis for a de facto standard in the domain of object-oriented


analysis and design founded on a wide base of user experience.

Saroj Shakya, OOSE, Nepal College of


06/26/24 21
Information Technology
OOAD

OOA
-Use Case (Essential)
-Domain Modeling (Object Identification)
-System Sequence Diagram (Message Identification)

OOD (Elaboration)
-Use Case (Real)
-Interaction Diagram (Message Design)
-Design Class Diagram (Responsibility Assignment)

Saroj Shakya, OOSE, Nepal College of


06/26/24 22
Information Technology
The UML

Saroj Shakya, OOSE, Nepal College of


06/26/24 23
Information Technology
Unified because it …
– Combines main preceding OO methods (Booch by Grady Booch, OMT by Jim
Rumbaugh and OOSE by Ivar Jacobson)

Saroj Shakya, OOSE, Nepal College of


06/26/24 24
Information Technology
Modelling because it is …
– Primarily used for visually modeling systems. Many system views are
supported by appropriate models

Saroj Shakya, OOSE, Nepal College of


06/26/24 25
Information Technology
Language because …
– It offers a syntax through which to express modeled knowledge

Saroj Shakya, OOSE, Nepal College of


06/26/24 26
Information Technology
and…What UML is not!

• A visual programming language or environment

• A database specification tool

• A development process (i.e. an SDLC)

• A panacea

• A quality guarantee

Saroj Shakya, OOSE, Nepal College of


06/26/24 27
Information Technology
History of the UML

During the 1990s many different methodologies their own set of notations

Method War

??Class??

Multiplicity indicator in OMT Aggregation symbol in Booch

Saroj Shakya, OOSE, Nepal College of


06/26/24 28
Information Technology
History of the UML
3 most popular methods: OMT (Rumbaugh), Booch, and OOSE (Jacobson).

OMT
Strong in analysis
Weaker in the design area.

Booch
Strong in design
Weaker in analysis.

Jacobson
Strong in behavior analysis
Weaker in the other areas.

Saroj Shakya, OOSE, Nepal College of


06/26/24 29
Information Technology
Why UML

Helps to reduce cost and time-to-market.

Helps managing a complex project architecture.

Helps to convey ideas between developers\designers\etc.

Saroj Shakya, OOSE, Nepal College of


06/26/24 30
Information Technology
The UML

1970 – Object-oriented modeling languages began to appear.

1996 – Release of UML 0.9 by by Grady Booch, Jim Rumbaugh of Rational


Software Corporation, Ivar Jacobson of Objectory company.

1996 – Release of UML 1.0 by Digital Equipment, HP, ILogix, IntelliCorp, IBM,
ICON, MCI, Microsoft, Oracle, Rational, TI and Unisys.

1997 – Release of UML 1.1 by IBM, ObjecTime, Platinum, Ptech, Taskon,


Reich and Softeam

2001 – Work on UML 2.0 specifications.

Saroj Shakya, OOSE, Nepal College of


06/26/24 31
Information Technology
The UML Fragmentary

Booch 91 OMT 1 OTHER OOSE

Unification
Booch 93 OMT 2

UM 0.8 1995

UML 0.9/0.91 Standardization


Jun to Oct 1996

UML 1.0 Jan 1997

Sept 1997 Industrialization


UML 1.1

Saroj Shakya, OOSE, Nepal College of


06/26/24 32
Information Technology
The UML
UM 1.1 1997

Editorial revision
with out significant
UML 1.2 1998
technical changes

UML 1.3 1999


Dependency
Relationship

UML 1.4 2001


Composition
Whole-part
Relationship
UML 2.0 2001/2002

Saroj Shakya, OOSE, Nepal College of


06/26/24 33
Information Technology
The UML

Structure?? Behavior??

Solution:
Create several diagrams, each focused on one view.
Each diagram provides a view into the elements that make up the system.

Saroj Shakya, OOSE, Nepal College of


06/26/24 34
Information Technology
The UML
Terms and Concepts
A system is a collection of subsystems organized to accomplish a purpose and
described by a set of models, possibly from different viewpoints.

A subsystem is a grouping of elements, of which some constitute a specification


of the behavior offered by the other contained elements.

A model is a semantically closed abstraction of a system, meaning that it


represents a complete and self-consistent simplification of reality, created in
order to better understand the system.

A view is a projection into the organization and structure of a system's model,


focused on one aspect of that system.

A diagram is the graphical presentation of a set of elements, most often


rendered as a connected graph of vertices (things) and arcs (relationships).

Saroj Shakya, OOSE, Nepal College of


06/26/24 35
Information Technology
The UML
Terms and Concepts
Activity 1

Think of some examples of systems.


…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………

A subsystem is a smaller system operating within some larger system and


supporting the over all objective of the larger system.

Activity 2

Think of sub systems that operate inside the systems discussed in Exercise 1.
…………………………………………………………………………………………
…………………………………………………………………………………………

Saroj Shakya, OOSE, Nepal College of


06/26/24 36
Information Technology
Diagrams in The UML

Saroj Shakya, OOSE, Nepal College of


06/26/24 37
Information Technology
Diagrams in The UML

Sequence Diagram

Collaboration Diagram

Saroj Shakya, OOSE, Nepal College of


06/26/24 38
Information Technology
A. Structural Diagrams

Saroj Shakya, OOSE, Nepal College of


06/26/24 39
Information Technology
1. Class diagram

Class diagrams commonly contain the following things:


· Classes
· Interfaces
· Collaborations
· Dependency, generalization, and association relationships

Class diagrams are static – display what interacts but not what happens when
interaction occurs.
May contain notes and constraints.

May also contain packages or subsystems, both of which are used to group
elements of your model into larger chunks

Saroj Shakya, OOSE, Nepal College of


06/26/24 40
Information Technology
1. Class diagram
1. To model the vocabulary of a system

Making a decision about which abstractions are apart of the system under
consideration and which fall outside its boundaries.

Used to specify these abstractions and their responsibilities.

Saroj Shakya, OOSE, Nepal College of


06/26/24 41
Information Technology
1. Class diagram
2. To model simple collaborations
A collaboration is a society of classes, interfaces, and other elements that work
together to provide some cooperative behavior

Saroj Shakya, OOSE, Nepal College of


06/26/24 42
Information Technology
1. Class diagram
3. To model a logical database schema
The blueprint for the conceptual design of a database.

Saroj Shakya, OOSE, Nepal College of


06/26/24 43
Information Technology
1. Class diagram
Classes are represented by a rectangle divided to three
parts: class name, attributes and operations.

Attributes are written as:


visibility name [multiplicity] :type-expression =initial-value

Operations are written as:


visibility name (parameter-list) :return type-expression

Visibility is written as:


+public
#protected
-private

Saroj Shakya, OOSE, Nepal College of


06/26/24 44
Information Technology
Class Diagram Relationships
Class Diagrams relationships:

Association –
Two classes are associated if one class has to know about the other. (uses)

Aggregation –
An association in which one class belongs to a collection in the other.(whole part)

Generalization –
An inheritance link indicating one class is a base class of the other.

Dependency –
A labeled dependency between classes ( such as friend, classes)

association aggregation realization

generalization composition dependency

Saroj Shakya, OOSE, Nepal College of


06/26/24 45
Information Technology
The UML
1 ..* 1 ..* 1
team player organ

0 ..*

Person Address
fixture
+firstName 1..*
+city
+lastName
+zipcode
+ID
+country
+address

Instructor Student CourseResult


n 1
-type +courseTaken +number
+calcAvg: double +title
+grade

Saroj Shakya, OOSE, Nepal College of


06/26/24 46
Information Technology
Case Study

Describing the use of a word processor


A user can open a new or existing document. Text is entered through a
keyboard. A document is made up of several pages and each page is made up
of a header, body and footer. Date, time and page number may be added to
header or footer. Document body is made up of sentences, which are
themselves made up of words and punctuation characters. Words are made
up of letters, digits and/or special characters. Pictures and tables may be
inserted into the document body. Tables are made up of rows and columns.
Users can save or print documents.

Saroj Shakya, OOSE, Nepal College of


06/26/24 47
Information Technology
Case Study
Describing the use of a word processor
A user can open a new or existing document. Text is entered through a
keyboard. A document is made up of several pages and each page is made up
of a header, body and footer. Date, time and page number may be added to
header or footer. Document body is made up of sentences, which are
themselves made up of words and punctuation characters. Words are made
up of letters, digits and/or special characters. Pictures and tables may be
inserted into the document body. Tables are made up of rows and columns.
Users can save or print documents.

Document
-noOfPages

+open()
+save()
+print()
+new()

Saroj Shakya, OOSE, Nepal College of


06/26/24 48
Information Technology
Case Study
Describing the use of a word processor
A user can open a new or existing document. Text is entered through a
keyboard. A document is made up of several pages and each page is made
up of a header, body and footer. Date, time and page number may be added
to header or footer. Document body is made up of sentences, which are
themselves made up of words and punctuation characters. Words are made
up of letters, digits and/or special characters. Pictures and tables may be
inserted into the document body. Tables are made up of rows and columns.
Users can save or print documents.

Page
-pageNumber

+newPage()
+hideHeader()
+hideFooter()
+insertPicture()

Saroj Shakya, OOSE, Nepal College of


06/26/24 49
Information Technology
Case Study
Describing the use of a word processor
A user can open a new or existing document. Text is entered through a
keyboard. A document is made up of several pages and each page is made up
of a header, body and footer. Date, time and page number may be added to
header or footer. Document body is made up of sentences, which are
themselves made up of words and punctuation characters. Words are made
up of letters, digits and/or special characters. Pictures and tables may be
inserted into the document body. Tables are made up of rows and columns.
Users can save or print documents.

Trimming
-date
-time
-pageNumber
+display()
+change()
+hide()
Saroj Shakya, OOSE, Nepal College of
06/26/24 50
Information Technology
Case Study
Trimming
-date
-time
-pageNumber
+display()
+change()
+hide()

Header Footer

+newHeader() +newFooter()

Saroj Shakya, OOSE, Nepal College of


06/26/24 51
Information Technology
Case Study
Describing the use of a word processor
A user can open a new or existing document. Text is entered through a
keyboard. A document is made up of several pages and each page is made up
of a header, body and footer. Date, time and page number may be added to
header or footer. Document body is made up of sentences, which are
themselves made up of words and punctuation characters. Words are made
up of letters, digits and/or special characters. Pictures and tables may be
inserted into the document body. Tables are made up of rows and columns.
Users can save or print documents.

Character
-ASCIICode
-type
+normal()
+italic()
+bold()
+underline()
Saroj Shakya, OOSE, Nepal College of
06/26/24 52
Information Technology
Case Study
Character
-ASCIICode
-type
+normal()
+italic()
+bold()
+underline()

Letter Punctuation Special Character Number

Saroj Shakya, OOSE, Nepal College of


06/26/24 53
Information Technology
Case Study
Describing the use of a word processor
A user can open a new or existing document. Text is entered through a
keyboard. A document is made up of several pages and each page is made up
of a header, body and footer. Date, time and page number may be added to
header or footer. Document body is made up of sentences, which are
themselves made up of words and punctuation characters. Words are made
up of letters, digits and/or special characters. Pictures and tables may be
inserted into the document body. Tables are made up of rows and columns.
Users can save or print documents.

Picture Table
-imageType -rows
-imageSize -columns
+insertRow()
+insert() +insertColum()
+delete() +insertTable()
+insertPicture()
Saroj Shakya, OOSE, Nepal College of
06/26/24 54
Information Technology
The UML

Saroj Shakya, OOSE, Nepal College of


06/26/24 55
Information Technology
2. Object Diagram
An object diagram shows a set of objects and their relationships.

Used to illustrate data structures, the static snapshots of instances of the


things found in class diagrams.

Object diagrams address the static design view or static process view of a
system just as do class diagrams, but from the perspective of real or
prototypical cases.

Author Computer Class Diagram


Uses
name: string name: string
0..1 1..*
age: integer memory: integer

Sam’s Job PC : Computer

name = “Dell 466”


Bob : Author memory = 64

name = “Harry S.” Object Diagram


age = 32 Sam’s HomePC : Computer

name = “Cmpq MMX”


memory = 32
Saroj Shakya, OOSE, Nepal College of
06/26/24 56
Information Technology
Exercise
A person owns a vehicle. A vehicle is anything that has round wheels and can
move around with load. A car is a kind of vehicle that has an engine and
airbags where as a lorry is also a simple kind of vehicle

An ATM has a cash dispenser, screen, keypad. It authenticates user against


bank database and executes transactions as per the user’s choice.

A person can own many vehicles, a vehicle must be registered , one person
must have vehicle registrations for each vehicle he owns. Every vehicle owner
must have a license to use the vehicle and the license may be valid or invalid.

Saroj Shakya, OOSE, Nepal College of


06/26/24 57
Information Technology
Exercise

Saroj Shakya, OOSE, Nepal College of


06/26/24 58
Information Technology
Exercise

A sales depot has customers and it holds stock. The stock is stocked as product
with product description, units and are ordered as sale item. Customer places
sales order that has order date , one sales order can have may sale items

A customer uses a shopping cart to do shopping online. Shopping cart contains


information like order id , customer id, orderTotal, each shopping cart can have
many items to buy and has information like order id, item quantity, item id
and items can be added and deleted as well. Each item to buy is one specific
type of item that has description, id and price.

Saroj Shakya, OOSE, Nepal College of


06/26/24 59
Information Technology
Exercise

Saroj Shakya, OOSE, Nepal College of


06/26/24 60
Information Technology
3. Component Diagram

Shows a set of components and their relationships.

Used to illustrate the static implementation view of a system.

Component diagrams are related to class diagrams in that a component


typically maps to one or more classes, interfaces, or collaborations.

Order uses Inventory


System System

Saroj Shakya, OOSE, Nepal College of


06/26/24 61
Information Technology
4. Deployment Diagram

A deployment diagram shows a set of nodes and their relationships.

Used to illustrate the static deployment view of an architecture.

Deployment diagrams are related to component diagrams in that a node


typically encloses one or more components.

client1.exe
clientA: <<TCP/IP>>
Compaq Pro
<<DECNET>>

Application DatabaseServer:
Server: Silicon VAX
<<TCP/IP>> Graphics O2

client2.exe
clientB:
Compaq Pro

Saroj Shakya, OOSE, Nepal College of


06/26/24 62
Information Technology
The UML
Assignment:

Draw a Class Diagram for a patient billing system.


Include only the attributes that would be appropriate for the
system’s context.

Patient (name, gender, address, ID, tel., DOB, blood type,


occupation, pass-times, adverse habits, insurance carrier,
dietary preferences)

Doctor (name, category, specialist, warrant No., preferred


sport, address, tel., DOB, weekly income, VAT No.)

Insurance carrier (date of establishment, name, registration


ID, company staff size, address, tel., contact person name)

Saroj Shakya, OOSE, Nepal College of


06/26/24 63
Information Technology
B. Behavioral Diagrams

The UML's five behavioral diagrams are used to visualize, specify, construct,
and document the dynamic aspects of a system.

Dynamic aspects of a system represent its changing parts.

Used to show how the system evolves over time (responds to requests , events
etc)

Dynamic aspects of a house : Dynamic aspects of a software system:

Airflow Flow of messages over time

Traffic through the rooms of a house Physical movement of components


across a network.

Saroj Shakya, OOSE, Nepal College of


06/26/24 64
Information Technology
B. Behavioral Diagrams

The UML's behavioral diagrams are roughly organized around the major
ways you can model the dynamics of a system.

1. Use case diagram Organizes the behaviors of the system

2. Sequence diagram Focused on the time ordering of messages

3. Collaboration diagram Focused on the structural organization of objects


that send and receive messages

4. Statechart diagram Focused on the changing state of a system driven by


events

5. Activity diagram Focused on the flow of control from activity to activity

Saroj Shakya, OOSE, Nepal College of


06/26/24 65
Information Technology
5. Use Case Diagram
A use case diagram shows a set of use cases and actors (a special kind of
class) and their relationships.

Usecase diagrams are especially important in organizing and modeling the


behaviors of a system.

Describes what a system does from the standpoint of an external observer.

Emphasis on what a system does rather then how.

- Scenario – Shows what happens when someone interacts with system.

- Actor – A user or another system that interacts with the modeled system.

A use case diagram describes relationships between actors and scenarios.

Provides system requirements from the user’s point of View.

Saroj Shakya, OOSE, Nepal College of


06/26/24 66
Information Technology
5. Use Case Diagram

POST

Buy Items

Log in

Refund
Purchased
Cashier items Customer

Saroj Shakya, OOSE, Nepal College of


06/26/24 67
Information Technology
5. Use Case Diagram

Use case Relationships:

Association – defines a relationship between an actor and a use case.

Extend - defines that instances of a use case may be augmented with


some additional behavior defined in an extending use case.

Use/Include - drawn as a dependency relationship that points from the


base use case to the used use case.
- defines that a use case uses a behavior defined in another use case.

Saroj Shakya, OOSE, Nepal College of


06/26/24 68
Information Technology
5. Use Case Diagram
Elicit
<<includes>> customer
needs

Make an
Interview

<<extends>> Produce SRS

Get
<<uses>> customer
details

Make
Deposit

Make
electronic
<<extends>> Deposit
Saroj Shakya, OOSE, Nepal College of
06/26/24 69
Information Technology
What a UCD is - and what it isn’t

Attention focused on the part of the business process that is going to be


supported by the IS.

It is the end-user perspective model.

It is goal driven

Helps to identify system services.

Are not used as DFDs.

Sequences, branching, loops, rules, etc. cannot (and should not) be directly
expressed.

Are often combined with activity diagrams, which serve as their


refinement

Saroj Shakya, OOSE, Nepal College of


06/26/24 70
Information Technology
Identifying Use Cases

User Cases are used to specify the functionality of a system from the user’s
perspective.

A usecase is made up of scenarios. A scenario describes how a user


interacts with the system in certain situations.

For example, from the point of view of the receptionist , a scenario for
booking an appointment for a patient with a doctor could be:

Ask the patient which doctor they want to see. Check the diary to see when
the next available appointments are. Agree the appointment date and time
with the patient. Enter the details on the system.

Saroj Shakya, OOSE, Nepal College of


06/26/24 71
Information Technology
Identifying business processes

Business processes are usually associated with a major business activity and
consequently make reference to a specific business entity. A business entity
here is anything which can be used to describe the business.
Some examples of business processes are:
Pay Employee
Schedule Delivery
Receive Payment
The structure of the examples above: verb +(singular) object.
One way to find business processes is to consider the life cycle of business
entities.
for a bakery we might identify:
Order Ingredient(s)
Bake Bread
Deliver Bread
Sell Bread

Saroj Shakya, OOSE, Nepal College of


06/26/24 72
Information Technology
Activity

Working in small groups(2/3), suggest use cases for a car manufacturer to


add to the ones identified below:
DesignVehicle
Make Vehicle
SellVehicle

For the business process ‘Recruit Staff’ – decompose this process by


completing the following:
Advertise ?
? Candidate
Appoint ?

Saroj Shakya, OOSE, Nepal College of


06/26/24 73
Information Technology
Activity

Complete the use case below representing part of a simple student


enrolment system
‘The Administrator at a local college enrols students onto courses as soon
as she receives a signed Registration Form from a student. She then needs
to update her Student Records with the student’s details before giving the
student a Student Card. This completes the enrolment process.’

Saroj Shakya, OOSE, Nepal College of


06/26/24 74
Information Technology
Activity
From the point of view of the receptionist in a Clinic, a scenario for booking
an appointment for a patient with a doctor could be:

Ask the patient which doctor they want to see. Check the diary to see when
the next available appointments are. Agree the appointment date and time
with the patient. Enter the details on the system.

Use Case Name????

Now produce a use case diagram for appointment related activities.


Possible use cases are:
BookAppointment
ListAppointments
BrowseAppointments
Possible actors(roles)are:
AppointmentArranger (Receptionist)
Doctor

Saroj Shakya, OOSE, Nepal College of


06/26/24 75
Information Technology
Activity

From the point of view of the receptionist in a Clinic, a scenario for booking
an appointment for a patient with a doctor could be:

Ask the patient which doctor they want to see. Check the diary to see when
the next available appointments are. Agree the appointment date and time
with the patient. Enter the details on the system.

Now produce a use case diagram for appointment related activities.


Possible use cases are:
BookAppointment (we have already a full description for this use
case)
ListAppointments
BrowseAppointmentsPossible actors(roles)are:
AppointmentArranger (Receptionist)
Doctor

Saroj Shakya, OOSE, Nepal College of


06/26/24 76
Information Technology
Activity

A customer must log in to the system but the system must authenticate
him first. After that the customer can start making booking which can be
done online as well.

Saroj Shakya, OOSE, Nepal College of


06/26/24 77
Information Technology
Activity

A customer can review his payment history after getting authorization from
the bank. He can make payment for things he buys online , there is also a
provision of electronic payment for customers.

Saroj Shakya, OOSE, Nepal College of


06/26/24 78
Information Technology
Activity

A system allows the clerk who enters orders from customers to manage the
customer details and also allows him to enter orders. For these purposes,
the customer record must be identified first.

Saroj Shakya, OOSE, Nepal College of


06/26/24 79
Information Technology
6. Sequence Diagram
A sequence diagram is an interaction diagram that emphasizes the time
ordering of messages.

A sequence diagram shows a set of objects and the messages sent and
received by those objects.

The objects are typically named or anonymous instances of classes, but may
also represent instances of other things, such as collaborations, components,
and nodes.

aStudnt:Studnt :Seminar

Classifiers or their instances, Activation boxes or method-


typically use cases, objects, invocation boxes, indicate
classes, or actors. processing is being performed by
the target object/class to fulfill a
message
Indicates Messages

Object lifelines, representing the


Indicates Return values life span of the object during the
scenario being modeled.
Saroj Shakya, OOSE, Nepal College of
06/26/24 80
Information Technology
6. Sequence Diagram
A sequence diagram is an interaction diagram that emphasizes the time
ordering of messages.

A sequence diagram shows a set of objects and the messages sent and
received by those objects.

The objects are typically named or anonymous instances of classes, but may
also represent instances of other things, such as collaborations, components,
and nodes.

aStudnt:Studnt :Seminar :Course

enrollStudent(aStudnt )

isStudentEligible (aStudnt)

getSeminarHistory()

seminarHistory
eligibilityStatus
enrollmentStatus

Saroj Shakya, OOSE, Nepal College of


06/26/24 81
Information Technology
7. Collaboration Diagram
A collaboration diagram is an interaction diagram that emphasizes the
structural organization of the objects that send and receive messages.

A collaboration diagram shows a set of objects, links among those objects,


and messages sent and received by those objects.

The objects are typically named or anonymous instances of classes, but may
also represent instances of other things, such as collaborations, components,
and nodes.

Sequence and collaboration diagrams are isomorphic, meaning that you can
convert from one to the other without loss of information.

:ClassA Instance :ClassB Instance


:ClassA Instance
Msg1() Msg1()
Msg2()
1: Msg1()
2: Msg2()
Msg3()
:ClassB Instance

Saroj Shakya, OOSE, Nepal College of


06/26/24 82
Information Technology
7. Collaboration Diagram

Difference?

A sequence diagram includes chronological sequence of messages


A sequence diagram does not include object relationships
Important to visualize timing order of messages

Collaboration diagram is used when you are interested in the structural


relationships among the instances in an interaction
Collaboration diagram emphasizes on the organization structure

:Computer [printer busy] :Queue


1.2: Store (File)

1: Print (File)

:PrinterServer :Printer
[printer free]
1.1 Print (File)

Saroj Shakya, OOSE, Nepal College of


06/26/24 83
Information Technology
8. Statechart Diagram
A statechart diagram shows a state machine, consisting of states, transitions,
events, and activities.

They are especially important in modeling the behavior of an interface, class,


or collaboration.

Statechart diagrams emphasize the event-ordered behavior of an object,


which is especially useful in modeling reactive systems.

Invoice created
unpaid

paying

Invoice destroying
paid

Saroj Shakya, OOSE, Nepal College of


06/26/24 84
Information Technology
9. Activity Diagram
An activity diagram shows the flow from activity to activity within a system.

An activity shows a set of activities, the sequential or branching flow from


activity to activity, and objects that act and are acted upon.

Shows what activities can be done in parallel, and any alternate paths through
the flow
Activity diagrams contain activities, transitions between the activities,
decision points, and synchronization bars

Activity diagrams emphasize the flow of control among objects.

Activity Transition Decision Synchronization


Bar
Saroj Shakya, OOSE, Nepal College of
06/26/24 85
Information Technology
9. Activity Diagram
Registrar Professor

Create Select Courses to


Curriculum teach

Assign Professor
to Course
No
All professors assigned?

Yes

Create Catalogue

Place Catalogue Mail Catalogue


in Book Store to Students

Open
Registration
Saroj Shakya, OOSE, Nepal College of
06/26/24 86
Information Technology
THE ARCHITECURE
The architecture of a software-intensive system can best be described
by the 4+1 interlocking views. Each view is a projection into the organization
and structure of the system, focused on a particular aspect of that system.

“architecture is the structure of the system, comprised of components or


building blocks the externally visible properties of those components, and the
relationships among them”

Implementation View
Logical /Design View
System Assembly,
Functionality,
configuration
Vocabulary
software management
Use Case View
Understandability
usability Deployment View
Process View
System Topology,
Performance Scalability,
Delivery, Installation,
Throughput
Communication
Saroj Shakya, OOSE, Nepal College of
06/26/24 87
Information Technology
The 4+1 View: use case view
The 'plus-one' view : further describe or consolidate the other views.
encompasses the use cases that describe the behavior of the system as seen by
its end users, analysts, and testers.

This view doesn't really specify the organization of a software system. Rather, it
exists to specify the forces that shape the system's architecture.

With the UML, the static aspects of this view are captured in use case diagrams;

Saroj Shakya, OOSE, Nepal College of


06/26/24 88
Information Technology
System components:
Record Shop :-
P: sell products (records), order stock, advertise products/shop, maintain
stock, manage staff, etc
I: cust queries, cust orders, cust payment, complaints, deliveries, supp
invoices, - -
O: cust receipts, supp payments, advertising literature, supp orders, - -
C: stock controls, quality controls, customer credit card checks, sales
analysis,- -
E: suppliers, banks, customers, record industry, pop culture, - -

High Street Bank (eg):-


P: process accounts transactions, produce statements, arrange loans, invest
capital, advise customers,, - -
I: queries, payments and withdrawals, customer details, transfer requests, -

O: statements, advice, cash, dividends, exchange rate information, - -


C: credit checks, overdraft arrangements, cheque clearance, cash-point
controls-
E: stock market, customers, Bank of England, society at large, gov’t
legislation, -
Saroj Shakya, OOSE, Nepal College of
06/26/24 89
Information Technology
The 4+1 View: use case view
Bus Company (eg):-
P: Plan routes, run service, maintain vehicles, issue tickets, inspect tickets, -
I: cust complaints, destinations, cash, supp invoices, parts details, - -
O: timetables, tickets, cust advice, supp payments, maintenance reports
C: vehicle servicing, vehicle checking, ticket/service inspection, complaints
procedure, -
E: road network, local authority, parts suppliers, gov’t legislation, society at
large,

4. Business processes:
Student Records - Enrol Student/ Tutor Student/ Assess Student/ Process
Result(s)/ Award Qualification/ - - (sensible others can be considered here)
[Students may need help with this – next example a little easier -]

Video shop – Check Membership No/ Note Video selected/ Receive


Payment/ Issue Video Copy/ Note Video Returned/ - -

Saroj Shakya, OOSE, Nepal College of


06/26/24 90
Information Technology
The 4+1 View: use case view

Any one who wishes to rent a video from the shop must first be registered
as a member. Members may rent out videos provided that they are old
enough, for this reason the Sales Assistant needs to record each member’s
date of birth when they join. It also records each member’s address and
phone number, so that they can trace them in the event of a video not
being returned.
Members can reserve a video provided a copy is available for the day they
require it and that they are genuine members. All video reservations are
recorded in the company’s video database so that the status of each copy
can be monitored. Reserved videos must be collected before 7pm.
To rent a video, members must present their Membership Card. Each video
attracts a rental charge depending on its popularity and how recently it has
been released. All Video rented out must be returned by 6pm the following
day otherwise members will be charged an extra day.
Staff need to update stock records with new titles or extra copies when
deliveries are received from Suppliers and deleting records of copies which
are lost or damaged on return.

Saroj Shakya, OOSE, Nepal College of


06/26/24 91
Information Technology
The 4+1 View: use case view

Saroj Shakya, OOSE, Nepal College of


06/26/24 92
Information Technology
The 4+1 View: The design view

encompasses the classes, interfaces, and collaborations that form the


vocabulary of the problem and its solution.

This view primarily supports the functional requirements of the system,


meaning the services that the system should provide to its end users.

With the UML, the static aspects of this view are captured in class diagrams and
object diagrams

Saroj Shakya, OOSE, Nepal College of


06/26/24 93
Information Technology
The 4+1 View: process view
encompasses the threads and processes that form the system's concurrency
and synchronization mechanisms. Deals with the dynamic aspects of a
system with activity diagrams

This view primarily addresses the performance, scalability, and throughput of


the system.

With the UML, the static and dynamic aspects of this view are captured in the
same kinds of diagrams as for the design view, but with a focus on the active
classes that represent these threads and processes.

Saroj Shakya, OOSE, Nepal College of


06/26/24 94
Information Technology
The 4+1 View: implementation view
encompasses the components and files that are used to assemble and release
the physical system. A programmers view

This view primarily addresses the configuration management of the system's


releases, made up of somewhat independent components and files that can be
assembled in various ways to produce a running system.

With the UML, the static aspects of this view are captured in component
diagrams

Saroj Shakya, OOSE, Nepal College of


06/26/24 95
Information Technology
The 4+1 View: The physical view
view
The physical view describes how the application is installed and how it executes
in a network of computers.

The deployment view of a system encompasses the nodes that form the
system's hardware topology on which the system executes.

This view primarily addresses the distribution, delivery, and installation of the
parts that make up the physical system.

With the UML, the static aspects of this view are captured in deployment
diagrams

Saroj Shakya, OOSE, Nepal College of


06/26/24 96
Information Technology
UP and Best Practices and Concepts
The central idea to appreciate and practice in the UP is short time boxed
iterative, adaptive development.
Another implicit, but core, UP idea is the use of object technologies, including
OOA/D and object-oriented programming.

Saroj Shakya, OOSE, Nepal College of


06/26/24 97
Information Technology
UP and Best Practices and Concepts
Some best practices and key concepts in the UP include:
i. Tackle high-risk and high-value issues in early iterations

If the new system is a server application that has to handle 2,000


concurrent clients , do not wait for many months (or years) to design and
implement this high risk requirement.
Rather, quickly focus on designing, programming, and proving the
essential software components and architecture for this risky issue; leave
the easier work till later iterations.
The idea is to drive down the high risks in the early iterations, so that the
project does not "fail late," which is a characteristic of waterfall projects
that defer hard, risky concerns till later in the lifecycle.
Better to "fail early" if at all, by doing the hard things first. Thus, the UP is
said to be risk driven.
Finally, notice that risk comes in many forms: lack of skills or resources,
technical challenges, usability, politics, and so on. All these forms influence
what is addressed in early iterations.

Saroj Shakya, OOSE, Nepal College of


06/26/24 98
Information Technology
UP and Best Practices and Concepts

ii. Continuously engage users for evaluation, feedback, and requirements

The majority of failed projects are correlated with lack of user engagement

iii. Build a cohesive, core architecture in early iterations

This is related to tackling the high-risk concerns in early iterations, since getting
the core of the architecture established is usually a risky or critical element.

Saroj Shakya, OOSE, Nepal College of


06/26/24 99
Information Technology
UP and Best Practices and Concepts

iv. Continuously verify quality; test early, often, and realistically

Furthermore, iterative development is based on feedback and adaptation;


therefore, early realistic testing and evaluation are critical activities to
obtain meaningful feedback.
This is in contrast to a waterfall project, where the significant quality
assurance step is done near the end of a project, when response is
the most difficult and expensive.
In the UP, quality verification is continuously integrated from the start, so
that there are not big surprises near the end of the project

Note that in the UP, quality verification also refers to process


quality—each iteration, assessing how well the team is doing.

Saroj Shakya, OOSE, Nepal College of


06/26/24 100
Information Technology
UP and Best Practices and Concepts
v. Apply use cases

Informally, use cases are written stories of using a system.


They are a mechanism to explore and record functional requirements,

The UP recommends applying use cases as the primary form for requirements
capture, and as a driving force in planning, designing, testing, and writing end-
user documentation.

Saroj Shakya, OOSE, Nepal College of


06/26/24 101
Information Technology
UP and Best Practices and Concepts

vi. Model software visually (with the UML)

An extraordinary percentage of the human brain is involved in visual


processing, which is a motivation behind the visual or graphical presentation of
information abstraction is a useful practice in thinking about and
communicating software designs, because this allows us to focus on important
aspects, while hiding or ignoring noisy details.

vii. carefully manage requirements

Being skillful in the elicitation, recording, prioritization, tracing, and lifecycle


tracking of requirements

Saroj Shakya, OOSE, Nepal College of


06/26/24 102
Information Technology
UP and Best Practices and Concepts

viii. Practice change request and configuration management

Change request management.


Although an iterative UP project embraces change, it does not embrace
chaos.

configuration management.
Configuration and build management tools are used to support frequent
(ideally, at least daily) system integration and test, parallel development,
separate developer workspaces and configurations, and version control—

Saroj Shakya, OOSE, Nepal College of


06/26/24 103
Information Technology
The Rational Unified Process

Control for an iterative and incremental life cycle is supported by employing


the Rational Unified Process—an extensive set of guidelines that address
the technical and organizational aspects of software development focusing
on requirements analysis and design.

Philippe Kruchten, who also led the development of the RUP, served as chief
architect for the project.

The Rational Unified Process is structured along two dimensions:


• Time—division of the life cycle into phases and iterations
• Process components—production of a specific set of artifacts with well-
defined activities
Both dimensions must be taken into account for a project to succeed.

Saroj Shakya, OOSE, Nepal College of


06/26/24 104
Information Technology
The Rational Unified Process
Structuring a project along the time dimension involves the adoption of the
following time-based phases:

Inception—specifying the project vision the seed idea for the development is
brought up to the point of being

Elaboration—planning the necessary activities and required resources;


specifying the features and designing the architecture the product vision and its
architecture are defined , specifying particular functional or nonfunctional
behavior

Construction—building the product as a series of incremental iterations


when the software is brought from an executable architectural baseline to being
ready to be transitioned to the user community

Transition—supplying the product to the user community(manufacturing,


delivering, and training)

Saroj Shakya, OOSE, Nepal College of


06/26/24 105
Information Technology
The Rational Unified Process
Structuring the project along the process component dimension includes the following
activities:

Business Modeling—the identification of desired system capabilities and user


needs

Requirements—a narration of the system vision along with a set of functional and
nonfunctional requirements

Analysis and Design—a description of how the system will be realized in the
implementation phase

Implementation—the production of the code that will result in an executable


system

Test—the verification of the entire system

Deployment—the delivery of the system and user training to the customer

Saroj Shakya, OOSE, Nepal College of


06/26/24 106
Information Technology
The Rational Unified Process

Saroj Shakya, OOSE, Nepal College of


06/26/24 107
Information Technology

You might also like