Uml Diagrams Practical Tutorial
Uml Diagrams Practical Tutorial
UML
Booch’s
OOSE Methodology
UML as A Standard
Adopted by Object Management Group
(OMG) in 1997
OMG is an association of industries
Promotes consensus notations and
techniques
Used outside software development
Example car manufacturing
Developments to UML
• UML UML 1.0
continues to
develop:
– Refinements UML 1.X
– Making it
applicable to
new contexts Application to
UML 2.0 embedded
systems
Why are UML Models Required?
A model is an abstraction mechanism:
Capture only important aspects and ignores the rest.
Different models result when different aspects are
ignored.
An effective mechanism to handle complexity.
UML is a graphical modelling tool
Easy to understand and construct
Modeling a House
UML Diagrams
Nine diagrams are used to capture
different views of a system.
Views:
Provide
different perspectives of a
software system.
Diagrams can be refined to get the
actual implementation of a system.
UML Model Views
Views of a system:
User’s view
Structural view
Behavioral view
Implementation view
Environmental view
UML Diagrams
Behavioural View
Structural View - Sequence Diagram
- Class Diagram - Collaboration Diagram
- Object Diagram - State-chart Diagram
- Activity Diagram
User’s View
- Use Case
Diagram
Play Move
Tic-tac-toe game
Player
<<include>>
<<include>>
<<include>> <<include>>
use case 2
Accounts
Print
Query balance
Balance sheet
Receive Make
grant payments
Class Diagram
• Describes static structure of a system
• Main constituents are classes and their
relationships:
– Generalization
– Aggregation
– Association
– Various kinds of dependencies
Class Diagram
• Entities with common features, i.e.
attributes and operations
• Classes are represented as solid outline
rectangle with compartments
• Compartments for name, attributes, and
operations.
• Attribute and operation compartments are
optional depending on the purpose of a
diagram.
Class Diagram
LibraryMember LibraryMember
LibraryMember
issueBook( );
findPendingBooks( );
findOverdueBooks( );
returnBook( );
findMembershipDetails( );
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
confirm
confirm
updateMemberBorrowing
4: selectBooks
2: findMemberBorrowing
12: confirm
:Library
Member
updateMemberBorrowing
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
Cancel [in stock] order item]
Order
Assign to Assign
[succeeded] Order Goods to
Order
[need to reorder]
Reorder
Item
Rejected Accepted
Order Order
[some items available]
[some items not processed / deliver
available] processed
[all items
Pending available] Fulfilled
Order newsupply Order
A piece of
hardware