Hi. In this lecture, we will talk about some additional components that you can use for drawing UML class diagram. Now let's start with an example. Let's say we want to build a system to keep track of student and random information and we have a set of students, and we have a set of courses and we keep track which student enrolled into which course. For example, Macro enrolled into COMP 3111, COMP 3021, and also COMP 3311. Now let's say if we wanted to also keep track an attribute like grade, then where should we store the grade? There are different options that we can use. The first option is that, we may store grade as an attribute under student. For example, for a student, we stored a grade for COMP 1212 and also for COMP 2012. Is this okay? No, this is not okay because we don't know exactly how many attributes that we need for a particular student, so this is not okay. This is the problem, we don't know how many grade attributes that we need for each student. Option number 2 is that can we use a multi-valued attribute for grade? For example, under student, we have an attribute called grade which is an array. Then we can store multiple grades under student. Is this okay? No, this is also not okay because we don't know which grade maps to which course. Now understood that we just have a set of grades, but we don't know exactly which grade maps to which course. This option, option number 2 is also not okay. Then let's talk about the next option which is using an associate class. This is another component that we can use for drawing UML class diagram. Whenever the association has properties, then we can model the properties of an association using attributes under the association. For example, when students enroll into a course, then we tried to keep track the grade, and we keep track a grade under the association. This is the situation, for example, Macro enrolled into COMP 3111 and then he gets an A plus. Then we start this attribute under the link between Macro and COMP 3111. As another example, let's say Jason takes COMP 3111 and then he gets an A. Then again we start the grade A under this link, then think about it, is this option okay? I would say no. Why? Let me give you an example. Now let's say we're using this model we have students and then students enroll into different courses. We try to keep track older grades using an association class enrolls in and then we try to keep track the attribute grade using this association class. Then under student, we may have many students. For example, we may have Kenneth, we may have Gibson, we may have Desmond and also we may have Dave. They are all students within the university. Then we have different causes for example, we have COMP 1001, we have COMP 3111, we have COMP 3311 etc. Now let's say we have this situation. Let's say Kenneth enrolls into COMP 3111 in the previous semester, then he failed. We try to sort the grade fail using association class. Then now let's say he takes COMP 3111 again in the semester and now this time he gets an A plus. Now using this model, can we store this information, yes or no? No. Now let's say we have a pair of instances, let's say Kenneth and COMP 3111 being connected using an association, using a link. Then notice that this is what you have to keep in mind. Notice that once a pair of instances they are related, they are related. We cannot relate the same pair of instances using two different links so now we can only keep one of the two links, but not both of them. Maybe we can simply keep track the most recent link, which is Kenneth enrolls into COMP 3111 again in the semester and then he gets an A plus. This is what we can keep track using this particular model and this is the restriction of this model. Again, keep in mind once they're related, they're related. We cannot relate the same pair of instances using more than one link. This is not allowed and then we have to remove one of the two links. If you want to keep track all the historical information, for example, Kenneth enrolled into COMP 3111 in the previous semester and then he failed, and then he takes it again in this semester and he gets an A plus. This information, you cannot store it using this particular model, so now how do we fix the problem? Because using this model, it's not allowed to have a student to enroll into the same cause multiple times through the association class enrolls in. Then we may have to use a more complicated model, which is this one. Now, students, they are not enrolled into different courses they are enrolled into different offerings of the course. What do we mean by offering? Now let me try to draw the example so we may have different students and we have also a set of courses. Then we relay students and courses to get our using offering. Now student, they are not ticking courses they are taking a particular offering of a course and then we try to keep track of grade of a particular offering. In case students takes and enrolls into different offerings. What do I mean by offering? Kenneth, we may have like set of students, like Kenneth, Gibson and then Dave and then maybe Desmond. Then we have a set of courses, maybe COMP 3111, and also COMP 3311 etc. Under a course, we can have different offerings in different semesters. That means we may have COMP 3111 for 2019 and also COMP 3111 in spring 2020. They are different offerings of COMP 3111. Now using this model it's possible that Kenneth enrolled into COMP 3111 for 2019 and then he gets an F. Then he enrolls into COMP 3111 in spring 2020 again, and then he gets an A plus. Now we have relating students and courses together through offerings and by using this model, we can keep track of all historical information. For example, Kenneth enrolls into COMP 3111 in 2019 and he gets an F. Kenneth also enrolls into COMP 3111 in spring 2020 and then finally he gets an A plus. Now using this more complicated model, we can actually keep track of all the historic information and we allows students to enroll into the same course multiple times through different offerings in different semesters.