Lab 6 of 7: CRCs, Contracts, and Method Specifications
Front:
|
Class Name: CourseList
|
ID: 2 |
Type: Concrete, Domain
|
|
Description:
This class maintains a list of courses that the Staff can use to retrieve a course.
|
Associated Use Cases:
Maintain Course |
|
|
Responsibilities
GetCourseByCourseID (string id)
|
Collaborators
|
Back:
|
Attributes:
For testing purposes, the CourseList will have an array CourseArray that is initialized with some test courses when an instance of the CourseList is created. This way we will have an already populated CourseList class with a number of Course objects. Here is a demonstration in Java:
class CourseList { public Course[] CourseArray = { new Course (“CIS 400”, "OO Analysis & Design", 4, "Important class", “CIS 110”) , new Course (“CIS 150A” , "VB.NET Programming", 4, "Good Introduction to programming", “CIS 100”) , new Course (“CIS 150B”, "C# Programming with labs", 4, "Follow-up to CIS 100", “CIS 100”) };
public CD GetCourseByCourseID (string id) { // ToDO } }
|
|
Relationships: Generalization (a-kind-of):
Aggregation (has-parts):
Other Associations: Course
|