




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





2
3
n A system consists of coordinating objects n Inheritance describes the hierarchical relationship between classes/ objects n Association between classes describes the role the objects of these classes play in the system n For example: Lecturer teaches Student; If Lecturer and Student are classes then teaches is an association between them
4
n BookBorrower borrows Copy of Book n Copy is copy of Book n Author writes Book n Student takes Module n Semester has Module
n Pattern: ClassName associationName ClassName
5
6
10
class A { B b; // declare ‘b’ void somethingACanDo() { b = anotherInstanceOfClassB; } }
11
class A { ... void somethingACanDo(B b) { b.doSomething(); } }
12
13
n Name of association and direction of message
n Associations with roles
University^ τ^ studies in Student
University^ paysυ Lecturer
University Person
student
employer teacher
14
n Multiplicity information specifies the number of instances that participate in a relationship
n Example: n A particular university has several students n A given student belongs to a single university
University^ |^ studies in Student
1 *
15
Examiner^ examines Paper
1 *
WorkDay^ has Shift
1 4
Worker^ works Shift
10..20 1..
19
Person
House buys
Semester Date
starts on
20
1..* 5..* Course Module
1..* 1..* EmployeeList Employee
21
1 0..* Window Button
1 9 TicTacToeGame Square
In compositions, the whole has a multiplicity of zero or 0..1; that is.. A part cannot be part of more than one whole
22
23