6.4. Composite Classes, Revisited

You might recall that when we talked about the fields of the Student class back in Chapter 3, we held off on assigning types to a few of the items shown in Table 6-1.

Table 6.1. Proposed Data Structure for the Student Class
Field NameData Type
namestring
studentIDstring
birthdateSystem.DateTime
addressstring
majorstring
gpadouble
advisorProfessor
courseLoad???
transcript???

Armed with what we now know about collections, we can go back and assign types to the courseLoad and transcript fields.

6.4.1.

6.4.1.1. courseLoad

The courseLoad field is meant to represent a list of all Course objects that the Student is presently enrolled in. So, it makes perfect sense that this field be declared to be simply a standard collection ...

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.