15.9. The Student Class (Dynamic Data Retrieval; Persisting Object State)

Aside from making a minor change to the ScheduleSection method of the Course class that we just discussed, and "refurbishing" the ScheduleOfClasses class that we previously discussed, the only other domain class that we wish to enhance among those that we created in Chapter 14 is the Student class. To demonstrate the techniques of dynamic data retrieval and data persistence, we're going to

  • Declare a ReadStudentData method that will read Student data from a file.

  • Add a WriteStudentData method that can be called from the SRS Main method when a student logs off, to persist the student's state by writing the current data back to his or her data file.

Much of the Student class's ...

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.