15.11. Revisiting the SRS Class
Having encapsulated so much functionality into the Student, ScheduleOfCourses, CourseCatalog, and Faculty classes allows us to dramatically simplify the Main method for the SRS "driver" class; let's revisit that class to see how it should be changed to accommodate all that we've done in this chapter.
The first part of the method creates CourseCatalog, ScheduleOfClasses, and Faculty objects in a process identical to what was done in the "test scaffolding" Main methods of the individual classes. The order that the objects are created is important, because a ScheduleOfClasses object needs a reference to a CourseCatalog, and a Faculty object needs a reference to a ScheduleOfClasses.
// Create CourseCatalog, ScheduleOfClasses, ...
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.