Lect8a UML
Lect8a UML
Lect8a UML
Unified Modelling
Language
Dr. Santosh Kumar Swain
Professor
School Of Computer Engineering
KIIT , Bhubaneswar.
10/22/2024 1
Different Object Modeling
Techniques in UML
OMT
UML
Booch’s
OOSE
Methodology
Background
Play Move
Tic-tac-toe game
Player
<<include>>
<<include>>
<<include>> <<include>>
<<include>>
<<include>>
Check Reservation
Factoring Use Cases Using
Extends
• Associations
• Aggregation
Relations • Generalization
Attributes
Operations
25
Class Diagram
• Displays objects structure, contents and
relationships.
• Class diagrams are static – display what
interacts but not what happens when
interaction occurs.
Object: Class
• A sequence diagram is
• An interaction diagram that
details how operations are
carried out.
• What messages are sent and
when.
• Sequence diagrams are
organized according to time
Message
Operations
Lifeline
39
Sequence Diagram Cont…
• Messages are shown as arrows.
• Each message labelled with corresponding
message name.
• Each message can be labelled with some
control information.
• Two types of control information:
– condition ([])
– iteration (*)
Elements of a Sequence Diagram
: Customer : Order : Payment : Product : Supplier
place an order
object process
validate
control lifetime
if ( payment ok )
if ( not in stock )
deliver
back order
get address
mail to address
message
Example
Cont…
place an order
process
validate
get address
mail to address
An Example of
A Sequence Diagram
:Library
:Library
:Library Book :Library
Book :Book
Boundary Renewal Member
Register
Controller
confir
m
confirm
updateMemberBorrowing
1: [reserved]
:Library
renewBook
:Library Book 7: apology
Boundary 3: display Renewal
Borrowing Controller
4: selectBooks
2: findMemberBorrowing
12: confirm
:Library
Member
updateMemberBorrowing
Start
Fork
Activity diagrams describe the workflow
behaviour of a system
Branch
Merge Joint
End
46
Activity Diagram
• Not present in earlier modelling techniques:
– Possibly based on event diagram of Odell [1992]
• Represents processing activity, may not
correspond to methods
• Activity is a state with an internal action and
one/many outgoing transitions
• Somewhat related to flowcharts
Activity Diagram vs Flow Chart
• Can represent parallel activity and
synchronization aspects
• Swim lanes can be used to group
activities based on who is performing them
• Example: academic department vs. hostel
Activity Diagram
• Normally employed in business process
modelling.
• Carried out during requirements
analysis and specification stage.
• Can be used to develop interaction
diagrams.
An Example of
An Activity Diagram
Academic Section
Accounts Section Hostel Office Hospital Department
check
student
records
receive
fees
allot create
hostel hospital
record
register
receive
in
fees
course
conduct
allot medical
room examination
issue
identity card
Activity diagram for student admission procedure at IIT
Activity Diagram: Example 2
Finance Order Stock
Receive Processing Manager
Order Receive
Supply
*[for each line
item on order] Choose
Check Outstanding
Authorize [failed] Line Item Order Items
Payment
* [for each chosen
[in stock] order item]
Cancel
Order Assign
Assign to
[succeeded] Order Goods to
Order
[need to reorder]
Reorder
Item
What is different
?
between activities
and Statemachine
diagram
54
State Chart Diagram
Cont…
Rejected Accepted
Order Order
[some items available]
[some items not processed / deliver
available] processed
[all items
Pending available] Fulfilled
Order newsupply Order
dependency
Components:
• Executables
• Library
• Table
• File
• Document
Component Diagram
• Captures the physical structure of the
implementation
• Built as part of architectural specification
• Purpose
– Organize source code
– Construct an executable release
– Specify a physical database
• Developed by architects and programmers
Deployment Diagram
• Captures the topology of a system’s
hardware
A piece of
hardware
Are All Views Required for Developing A
Typical System?
NO
For a simple system:
Use case diagram, class diagram and one of the
interaction diagrams only.
State chart diagram:
when class has significant states.
When states are only one or two, state chart model
becomes trivial
Deployment diagram:
In case several hardware components used to
develop the system.
A Design Process
– Developed from various methodologies.
• However, UML has been designed to be usable
with any design methodology.
– From requirements specification, initial
model is developed (OOA)
• Analysis model is iteratively refined into a design
model
– Design model is implemented using OO
concepts
OOAD
Iterative and Incremental
OOA OOD/OOP
Domain
Specification Model Construction of
Definition of Program
the problem Use the solution
case
model
Unified Development Process
Cont…
OOA OOD
User interface
Use case Interaction
Issues or GUI
prototype diagram diagram
Start
Glossary
Example 1: Tic-Tac-Toe Computer Game
Play Move
Board
PlayMoveBoundar PlayMoveControll
Board
y er
:playMove :playMove
Boundary Controller
:board
acceptMove checkMoveValidity
move
[invalidMove] [invalidMove]
announceInvalidMove
announceInvalidMove
checkWinner
[game over]
[game over] announceResult
announceResult
playMove
checkWinner
displayBoardPositions getBoardPositions
Board PlayMoveBoundary
int position[9]
Controller
announceInvalidMove
announceResult
Example 2: Supermarket Prize Scheme
register
Customer customer Clerk
register
sales
Sales Clerk
select
winners
Supermarket
Prize scheme
Manager
Example 2: Initial Domain Model
CustomerRegiste
SalesHistory
r
1 1
* *
SalesRecords CustomerRecord
CustomerRegiste
SalesHistory
r
1 1
* *
SalesRecords CustomerRecord
RegisterCustomerBound RegisterCustomerContr
ary oller
RegisterSalesBoundary RegisterSalesController
SelectWinnersController
SelectWinnersBoundary
s
Select
SelectWinners
Winners
SelectWinners
*computeSales
*browse
register
register
checkDuplicate
*match
[duplicate]
showError
generateCIN
create
register :Customer
Record
displayCIN
:Register :Register
:Sales
Sales Sales
History
Boundary Controller
RegisterSales registerSales
registerSales
create :Sales
Record
confirm
confirm
:Register
:Sales
Sales
History
Boundary
registerSales
RegisterSales
create :Sales
Record
confirm
SalesHistory CustomerRegister
selectWinners findWinnerDetails
registerSales register
1 1
* *
SalesRecords CustomerRecord
salesDetails name
address
computerSales browse
browse checkDuplicate
create create