-The next example of relationship we're going to look at is - -2
-the association relationship. This is a relationship in which objects of - -3
-one class are connected to objects of another. And it's - -4
-called an has a relationship. So it means that objects of - -5
-one class have objects of another class. So let's see - -6
-what that means. Let's do it by considering two classes in - -7
-our example system. The student class and the course offering class. - -8
-In this case, there is an association between the student and - -9
-the course offering, because the student is registering for the - -10
-course offering. So, in a sense, the course offering has students. - -11
-Contains students, to indicate this fact we add a solid - -12
-line between the student class and the course offering. And the - -13
-fact that having a solid line doesn't really tell us - -14
-much about the nature of the relationship, so to clarify such - -15
-nature we can use what we call adornments that we - -16
-can apply to associations we can add to associations to clarify - -17
-their meaning. In particular we can add a label to - -18
-an association and the label describes the nature of the relationship. - -19
-In this case, for example, it clarifies that the student - -20
-registers for CourseOffering. We can also add a triangle to - -21
-further clarify the direction of the relationship. So in this - -22
-case, the triangle will indicate that it's the student That registers - -23
-for the course offering, and not the other way around. Another - -24
-important adornment or limitation that we can put on an association, - -25
-is multiplicity. Multiplicity defines the number of instances of one - -26
-class that are related to one instance of the other - -27
-class. We can define multiplicity at either end of the - -28
-relationship. In this case, for instance, we can say that - -29
-if we look at the student, the student can register - -30
-for two or more course offerings. Whereas, if we look - -31
-at the course offering, we can say that each course - -32
-offering can have or can enroll between 1 and 50 students. - -33
-So as you can see by adding a label, a direction, - -34
-and multiplicity, we make it much clearer what the relationship is - -35
-and what it means and what are its characteristics. As we - -36
-saw when we introduced relationships, there is a different kind of - -37
-association, kind of a specialized one, which we call aggregation. So - -38
-here we're going to look at an example of an aggregation. So - -39
-first of all what is an aggregation? An aggregation is a - -40
-relationship between 2 classes in which 1 represents a larger class - -41
-like a whole which consists of smaller classes which are - -42
-the parts of this whole. So lets look at an example - -43
-in the context of our system. Let's consider a Course - -44
-and the CourseOffering. And in this case, we can see - -45
-that the Course consists of multiple CourseOfferings. So in - -46
-a sense, a course is a whole and the course offerings - -47
-are the parts of this whole. So this a perfect case - -48
-in which we will use an aggregation to express this relationship. - -49
-So we will add a solid line with a diamond on the side of the whole class - -50
-to indicate that the course consists of multiple course offerings. - -51
-And as we did for associations even though we - -52
-are not going to do it for this specific - -53
-example, we could also in this case add multiplicity - -54
-information on the aggregation to indicate how many classes - -55
-of the two types are involved in the relationships. -- cgit 1.4.1