From a design point of view, technically the student id number should be a part of the student class. The reasoning is that students have identification numbers, not student records. In theory, a student could have many student records, say one for each year of study. Since there is a student record instance contained in the student class, then that student record is linked to the student implicitly and therefore does not need to record the student id as this is already held in the student class.
In the exercises leading up to the homework, we were only dealing with student records and therefore really needed to have the student id number in that class. Now that we have the extra abstraction of a student record, the student id number belongs with the student class and not the student record class. This is just my observations and guess as the reason for the movement of the student id number. I hope this answers your question. Maugan. jasonbailey wrote: > HI > > I'm a bit confused by the homework, this bit.. > > # The Student class has studentId instance variable whose type is > Integer type. > # Move the studentCount static variable from the StudentRecord class > to Student class. > > Shouldn't the studentId be part of the studentRecord class rather than > the student class? I've moved the studentCount to student as static > and that's fine. > > I could add setters/getters to the student class but I'm not sure of > the point. Is there something I should be setting it to? > > Thanks > Jason > > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.409 / Virus Database: 270.13.61/2314 - Release Date: 08/19/09 > 18:06:00 > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
