Professional Documents
Culture Documents
Outline
w Use-case diagrams
w Activity diagrams
w Sequence diagrams
w Class diagrams
1
6/29/20
Course Catalog
Maintain Professor
Register for Courses Information
Student
Registrar
Select Courses to
Teach Close Registration
Professor
Submit Grades
Billing System
2
6/29/20
<<include>> <<include>>
<<include>>
Supply
Arrange delivery
Customer Data
shared functionality
3
6/29/20
http://www.neav
e.com/games/in
vaders/
Exercise 1 Solution
Move Left
Move Right
Fire Laser
Player
View High Scores
Play Game
4
6/29/20
Exercise 2
Consider Sonic the
hedgehog.
1. What can sonic do?
2. What are the use
cases?
3. Are there any
relationships
4. Draw the use case
diagram
1. Move left
2. Move right
3. Jump
4. Jump left
5. Jump right
6. Spin Dash
7. Pause
http://www.ebaumsworld.com/games/play/1108/
Move Right
<<extend>>
Player Jump Left
Jump <<extend>>
Pause Game
10
5
6/29/20
Outline
w Use-case diagrams
w Activity diagrams
w Sequence diagrams
w Class diagrams
11
Student Enrollment
System
IIT
Enrollment
Student Registrar
<<include>>
Course registration
12
6
6/29/20
SEIIT System
w Here different activities are:
§ Received enrollment form filled by the student
• Registrar checks the form
• Input data to the system
• System authenticate the environment
§ Pay fees by the student
• Registrar checks the amount to be remitted and prepare a bill
• System acknowledge fee receipts and print receipt
§ Hostel allotment
• Allot hostel
• Receive hostel charge
• Allot room
§ Medical check up
• Create hostel record
• Conduct medical bill
• Enter record
§ Issue library card
§ Issue identity card
13
Hostel
Payment fees Medical check
allotment
14
7
6/29/20
w Flow/ edge
§ The arrows in the diagram. No label is
necessary
15
parallel activities
w Join
§ A block bar with several flows entering Issue identity Issue library
card card
it and one leaving it. this denotes the
end of parallel activities
w Merge
§ A diamond with several flows entering
and one leaving. The implication is that
all incoming flow to reach this point
until processing continues
16
8
6/29/20
§ A join is different from a merge in that the join synchronizes two inflows
and produces a single outflow. The outflow from a join cannot execute
until all inflows have been received
§ A merge passes any control flows straight through it. If two or more
inflows are received by a merge symbol, the action pointed to by its
outflow is executed two or more times
17
horizontal or vertical
18
9
6/29/20
1
Received form
Hostel
Payment fees Medical check
allotment
2
Issue identity Issue library
card card
19
[Incorrect]
Regret message
[Correct]
Regret
registration
20
10
6/29/20
Display Calculate
1 enrollment form registration fees
Dispaly fees
payable screen
Process
payment
Pay fee 2
Print receipt
21
Fill-in
form
Verify the [Found]
[Incorrect]
applications
[Not Found]
Check
Regret message
Registrar
form
[Correct]
Display student
screen
Create record
System
Input student
information
[Match]
1
Search for Student
selection list [No Match]
Regret
registration
22
11
6/29/20
Sequence Diagram
23
1: create schedule( )
2: get course offerings( )
3: get course offerings(forSemester)
4: get course offerings( )
ref
Select Offerings
24
12
6/29/20
Lifelines
25
Actor instances
26
13
6/29/20
1: create schedule( )
27
1: create schedule( )
Execution
Occurrence
28
14
6/29/20
1: create schedule( )
Event Occurrence
29
1: create schedule( )
ref
Select Offerings
30
15
6/29/20
Outline
w Use-case diagrams
w Activity diagrams
w Sequence diagrams
w Class diagrams
31
32
16
6/29/20
33
Schedule
CloseRegistrationForm CloseRegistrationController
Professor
Student
Course CourseOffering
CourseCatalogSystem
BillingSystem
34
17
6/29/20
35
E.g. Class diagram for UC “Register for course”
<<interface>>
RegistrationController ICourseCatalogSystem
0..* 1
+ // submit schedule () + courseCatalog + getCourseOfferings ( [in] forSemester : Semester) : CourseOfferingList
+ // save schedule ()
+ // create schedule with offerings ()
+ // get course offerings () 0..1
Schedule
0..1
- semester : Semester
0..1
+ submit ()
+ currentSchedule + //save ()
# any conflicts? ()
0..1 + registrant 1 0..* + //create with offerings()
0..* 0..*
Student
alternateCourses + primaryCourses
- name 0..2 0..4
- address
- StudentID : int
CourseOffering
+ addSchedule ( [in] aSchedule : Schedule )
+ getSchedule ( [in] forSemester : Semester ) : Schedule - number : String = "100"
+ hasPrerequisites ( [in] forCourseOffering : CourseOffering ) : boolean - startTime : Time
# passed ( [in] aCourseOffering : CourseOffering ) : boolean - endTime : Time
- day : String
+ addStudent ( [in] aStudentSchedule : Schedule)
+ removeStudent ( [in] aStudentSchedule : Schedule)
+ new ()
+ setData ()
PartTimeStudent FullTimeStudent
+ maxNumCourses + gradDate
35
University
Artifacts
36
18
6/29/20
Registration
CloseRegistrationForm CloseRegistrationController
RegisterForCoursesForm RegistrationController
37
What Is an Association?
• The semantic relationship between two or more classifiers
that specifies connections among their instances.
• A structural relationship specifying that objects of one thing
are connected to objects of another thing.
38
19
6/29/20
What Is Multiplicity?
• Multiplicity is the number of instances one class
relates to ONE instance of another class.
• For each association, there are two multiplicity
decisions to make, one for each end of the
association.
• For each instance of Professor, many Course Offerings
may be taught.
• For each instance of Course Offering, there may be either
one or zero Professor as the instructor.
instructor
Professor CourseOffering
0..1 0..*
39
Multiplicity Indicators
Unspecified
Exactly One 1
Zero or More *
40
20
6/29/20
Example: Multiplicity
1
RegisterForCoursesForm RegistrationController
1
0..1
0..1
1 0..*
Student Schedule CourseOffering
0..* 0..4
41
What Is an Aggregation?
• A special form of association that models a whole-part
relationship between the aggregate (the whole) and its
parts.
• An aggregation is an “is a part-of” relationship.
• Multiplicity is represented like other associations.
Whole 1 Part
0..1
42
21
6/29/20
Example: Aggregation
1
RegisterForCoursesForm RegistrationController
1
0..1
0..1
1 0..*
Student Schedule CourseOffering
0..* 0..4
43
44
22
6/29/20
+ withdraw()
+ createStatement()
Generalization
Relationship
Subclasses
Savings Checking
(children)
Descendents
45
FlyingThing Animal
Multiple Inheritance
46
23