Informatiques
Roel Wuyts
ULB
2005/2006
http://decomp.ulb.ac.be/education/ami0506/
Sequential approach: case study
We’ll take a problem statement and
✦ define use cases
✦ design the system
‣ build class diagrams
‣ complement with interaction diagrams
3
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Make use cases
Remember:
✦ What are the actors?
✦ What are their relations (if any)?
✦ What are the use cases?
✦ Associate actors and use cases
4
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Finding actors
From the problem statement we can find the following terms
and entities specific to the system:
✦ Courses and Topics that make up a course
✦ Tutors who teach courses
✦ Course administrators who manage the assignment of the
courses to tutors
✦ Calendar or Course Schedule is generated as a result of
the course management system
✦ Students who refer to the Course schedule or Calendar
to decide which courses they wish to take up for study
5
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Finding actors (ctd)
What are the active parts in the previous list?
✦ Tutors
✦ Course administrators
✦ Students
Difference between tutors and students, and
administrators
✦ the course administrator is the primary actor
✦ students and tutors are secondary actors
6
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Finding use cases
The primary business flows in the system are:
✦ Manage courses
✦ Manage course assignments
Let’s have a look at these two in more detail
7
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Managing courses
We can find the following processes for managing
courses:
✦ View courses
✦ Manage topics for a course
✦ Manage course information
8
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Manage course assignments
Similarly, we can identify the following processes for
managing course assignments:
✦ View course calendar
✦ View tutors
✦ Manage tutor information
✦ Assign courses to tutors
9
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
So..
We found one primary actor: course administrators
And the following use cases:
✦ View courses
✦ Manage topics for a course
✦ View tutors
10
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Use case diagram
Courseware Management System
View courses
Manage course
information Manage topics for
a course
Student
View course
calendar
View tutors
Course
Administrator
Tutor
Manage tutor
Assig courses to information
tutors
11
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Build class diagram
We now have use cases
✦ what does the system do?
Now let’s design the system
✦ how does the system accomplishes its goal?
✦ Can use responsibility-driven design
‣ Find responsibilities from requirements, and distribute
them over classes
✦ Or can get them from use cases
12
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Identifying classes
Actors are primary entities in the system
✦ will be mapped on classes
Also have passive entities (courses, topics, calendar)
✦ also will be mapped to classes
13
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Identifying methods
CourseAdministrator is the primary actor
✦ use cases it is connected to become methods
ClassName Methods
viewCourses()
manageCourse()
manageTopic()
CourseAdministrator viewCourseCalendar()
viewTutors()
manageTutorInformation()
assignTutorToCourse()
14
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Identifying methods (ctd)
Add methods for domain knowledge
ClassName Methods
viewAllCourses()
viewCourseInformation()
Course createCourse()
modifyCourse()
removeCourse()
viewAllTopics()
viewTopicInformation()
Topic createTopic()
modifyTopic()
viewTutorInformation()
createTutor()
Tutor modifyTutor()
removeTutor()
CourseCalendar viewCourseCalendar()
viewAllStudents()
Student viewStudentInformation()
15
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Classes
CourseAdministrator
+viewCourses() Tutor
+manageCourse() Student
+viewTutorInformation()
+manageTopic()
+createTutor() +viewAllStudents()
+viewCourseCalendar()
+modifyTutor() +viewStudentInformation()
+viewTutors()
+removeTutor()
+manageTutorInformation()
+assignTutorToCourse()
Topic Course
16
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Finding relations
Let’s highlight the actors in our original description:
17
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Finding relations
Now let’s find relations between the classes:
18
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Finding relations
“Each course is made up of a set of topics”
Topic Course
The organization publishes and maintains a calendar ... and ... tutors
...
19
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Class Diagram
CourseAdministrator
+viewCourses() Tutor
+manageCourse() Student
manages +viewTutorInformation()
+manageTopic()
+createTutor() +viewAllStudents()
+viewCourseCalendar()
+modifyTutor() +viewStudentInformation()
+viewTutors()
+removeTutor()
+manageTutorInformation()
+assignTutorToCourse()
Topic Course
20
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Adding interactions
Let’s add some interactions to complement the
(static) class diagrams
✦ sequence diagrams
✦ collaboration diagrams
These come normally from the use case descriptions
✦ which we have not looked at in this case
21
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Manage course information
The sequence of steps carried out in the "Manage course information"
flow are:
✦ A user who is a course administrator invokes the manage course
functionality.
✦ The manage course functionality of the course administrator invokes
either the course creation or course modification functionality of a
course.
✦ After the course is either created or modified, the manage topic
functionality of the course administrator calls the topic creation or
modification functionality of a topic.
✦ Finally, the user invokes the assign tutor to course functionality of
the course administrator to assign a tutor to the selected course.
22
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
With a sequence diagram
manageCourse()
createCourse()
course:
Course
courseID
createTopic()
topic: Topic
topicID
assignTutorToCourse()
23
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
With a collaboration diagram
course:
Course
user <<new>>
1 : manageCourse() 1..*
1.1 : courseID := createCourse()
0..*
admin: topic: Topic
CourseAdministrator 1.2: topicID := createTopic() <<new>>
1.3: assignTutorToCourse()
tutor: Tutor
24
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
Wrap-up
Sequential approach example using OO
✦ Use case analysis
✦ OO design
✦ (implementation)
Illustrates mechanism for finding classes/methods
25
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006
References
Took the example from:
http://www.developer.com/design/article.php/1593811
But adapted it because there are errors in the
solution on the website...
26
Roel Wuyts - ULB - Analyse et Méthodologie Informatiques - 2005/2006