View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sp2001 Midterm Review: Analyze Student/Classroom Code

Analyze the code here:

Would it be an association or HasA relationship?
This would definitely be a HasA relationship since a student instance is added to a Classroom. This means that a Classroom has 0.. students. It probably stores instances of Student objects in a collection of some sort such that a classroom at any time contains a number of students. At any point of time we can obtain a list of students in a classroom. A student on the other hand does not have a relationship with Classroom. In fact it does not even know about the Classroom class.

Student - knows its name, section and number. can return these values.
Classroom - knows its name and list of students in that classroom. Can return these values.

Bharath Hemachandran

Classrooms have another important service. Mark Guzdial

Classes can also add a student

Link to this Page