7.2.9 Teacher Class List Methods Info

| Method | Design Pattern | Rationale | |--------|----------------|-----------| | generateReport | Template Method | Report structure (header, rows, footer) is fixed; content varies. | | sortByPerformance | Strategy | Allows runtime swapping of comparison algorithms. | | filterByAttendance | Immutable Copy | Prevents accidental modification of original roster. | | exportToParentPortal | Observer | Parents subscribe to student updates; teacher method triggers notification. |

[3] R. Garcia, "Teacher dashboard usability: A longitudinal study," in Proc. ACM Conf. on Human Factors in Computing Systems (CHI) , 2022, pp. 112–124. 7.2.9 Teacher Class List Methods

function sortByPerformance(c, comp): // In-place merge sort for stability and O(n log n) worst-case c.students = mergeSort(c.students, comp) c.notifyViewers("List sorted by performance") If c is empty, return without action. If comp is null, use default compareByGradeDesc() . 3.2.3 filterByAttendance(ClassList c, int minPercent) Purpose: Return a new ClassList containing only students with attendance ≥ minPercent . The original list remains unchanged (immutability pattern). | Method | Design Pattern | Rationale |

function generateReport(c, d): report = new Report("Class Report for " + d) for student in c: summary = new StudentSummary(student.name) summary.grades = fetchGrades(student, d) summary.attendance = fetchAttendance(student, d) report.addRow(summary) return report.toPDF() O(n * m) where n = students, m = grade records per student. 3.2.2 sortByPerformance(ClassList c, Comparator<Student> comp) Purpose: Sort the class list in-place by academic performance (e.g., descending grade average). Uses the provided comparator to allow alternate metrics (e.g., improvement rate). | | exportToParentPortal | Observer | Parents subscribe

[2] E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software . Addison-Wesley, 1995.

n = number of students; m = report entries per student; p = parents per student. We deployed a prototype implementing Section 7.2.9 in a suburban school district. 45 teachers (grades 3–12) used the system for 8 weeks.