Tut 02
Tut 02
Software
Engineering
and Project
Management
Tutorial Group 1
Download Presentation
Slides
Web:
http://learn.hkmu.edu.hk/~t4412
84
Presentation Outlines
Review of last tutorial
Unit 1
Introduction to Software Engineering and
UML (Part 2)
Q&A
Outline for next tutorial
Review of Last Tutorial
Four aspects of SE
Development and management activities
of SE
Introduction to UML
Use case diagram
Class diagram
Interaction diagram
Statechart diagram
Activity diagram
Side notes on Visual
Paradigm
The quality for exporting diagram to
GIF/JPEG is acceptable
File Export Active Diagram as
Image
UML diagrams
UML diagrams
Deeper View – Use Case
Diagram
Use Case Diagrams
The diagram:
Represents functionality of the system from user’s point of view. It also called a
functional model
Defines boundaries of the system
Used during requirements elicitation to represent external behavior
Additional description can be added as a “note symbol”
OLE Forum
Write message Special privileges is
required
Delete message
User
Read message
Use Case Diagrams
Actors:
Represent roles (i.e. a type of user of the system)
Use cases:
Represent a sequence of interaction for a type of functionality
Use case model:
The set of all use cases. It is a complete description of the functionality of the
system and its environment
Ticket System
PurchaseTicket
CheckTrain
Schedule
Passenger
ValidateTicket
Use Case Diagrams
Each actor models an external entity which communicates with the system. e.g.:
General users
External systems
Each actor has a unique name and an optional description. e.g.:
Passenger: A person in the train
Student: Course participants
Librarian: Staff in the library
Library System
Student ReserveBooks
Librarian
CheckBook
Information UpdateBook
Other Lib. Information
System
Use Case
understand the difference between use case diagram and us
Event flow:
1. Peter selects Mongkok station as the destination.
2. Distributor displays the amount due.
3. Peter inserts money.
4. Distributor returns change.
5. Distributor issues ticket.
xt n d>
<<
e >
<<
ex
te
nd
OutOfOrder TimeOut
>>
Cancel NoChange
The <<extend>> Relationship
Purchase <<e
Ticket xte
nd>
>
TimeOut
relationships).
in
<< in
cl
<<extend>>
more detailed meaning to the
Cancel Collect diagram. <<include>> and
d>> Money
t en <<extend>> are 2 examples
< <ex
used in Use Case diagram
NoChange
The <<include>> Relationship
Purchase <<include>> <<include>> Purchase
Collect
SingleTicket Money MultiTicket
Purchase
Ticket
Purchase Purchase
SingleTicket MultiTicket
The inheritance relationships
Use case name PurchaseTicket
Participating Initiated by Passenger
actor
Flow of events
Entry condition Passenger standing in front of ticket distributor.
Passenger has sufficient money to purchase ticket.
Exit condition Passenger has ticket.
Association
Relationship between classes
Role
Give meaning to an association
Officer Report
author reportsGenerated
Association name
Class Diagram
Multiplicity
Indicates how many objects participate in a given
relationship
One-to-one, one-to-many, many-to-many
0 1 0..n 1..n n 0..* 1..* * etc.
1 0..n
Officer Report
author reportsGenerated
Customer Account
1 1..4
Class Diagram
Aggregation and Composition
Captures “Whole/part” relationship
Car Wheel
1 4
Car Wheel
1 4
Vehicle
Car Ship
Navigation arrow
Associations can be bi-directional or uni-directional
Navigation arrow indicates the direction of associations
* *
Polygon Point
* *
Course Student
* *
Course Student
Deeper View – Object
Diagram
Object Diagram
Modified form a class diagram
FieldOfficer
Class becomes Object (instance of class)
Underline the object name to represent object
name
Example badgeNumber
john
john : FieldOfficer Class
thomasPC : Computer
Attribute value for an object
Also an object
john:FieldOfficer
Underline it as well
John Wong : name
1357 : badgeNumber
Object
Object Diagram
Associations (in class diagram) becomes actual links (in object
diagram)
Multiplicity does not apply in object diagram
Student Course
1 1..4
m212 : Course
t361 : Course
More on classes and objects
Abstract class
Class which cannot be instantiate
Cannot create object using abstract class Vehicle
Consider the Vehicle class in the diagram
Notes
Staff
Sometimes both class defined in a hierarchy
can be concrete class
For example
Manager
Staff and Manager
More on classes and objects
Method of a class
Also known as operation Car
Call a method of an object
Means sends a message to an object moveForward( )
moveBackward( )
:CarContr :Car
ol
moveForward( )
Deeper View – Interaction
Diagram
Interaction Diagram
Represent system’s behavior in terms of interactions
among a set of objects.
Two types of diagrams
1) Sequence diagram 2) Collaboration diagram
:UserInterface :TimeControl
:User
Lifeline
Check current time getTime( )
time
Current time
Activatio
n of
object
Interaction Diagram
Sequence Diagram
Object creation and destruction
Interaction Diagram
Sequence Diagram
Condition and iteration
Interaction Diagram
Sequence Diagram
Timing constraint
Sending time, receive time, elapsed time, queue
time, etc.
1 1.1
2
2.1
3
3.1 3.2
4 4.1
4.2
Interaction Diagram
What are the pros and cons between sequence
diagram and communication diagram?
Sending messages
Message ordering
Self-transition
State B
Statechart Diagram
Button1
Button2
Statechart Diagram
Nested State
Deeper View – Activity
Diagram
Activity Diagram
Represent data flow or control flow through a system
Initial and stop states
Not mandatory but increase readability
Decision
Apply 7-day
extension
Activity Diagram
Synchronization bar
Fork, Join, Swimline
Prepare
Developer
Software Tools
Prepare Develop
Create Project Hardware Application
Create
Database Admin
Database
End