3/6/08

Notes for this example:

1) This example is for those of you doing an OO design.

2) Make sure that both ends of associations are labeled with their multiplicity.

3) Separating the class diagram into multiple diagrams helped these students to show the class relationships all in one figure. That is, they created Figure 2.2 (showing the relationships), and then showed the detail of each class in the succeeding sections. Remember that you only need to show the attributes and methods that you know of as of the writing of the SDD.

4) Please single-space your text.

2.2 Decomposition Description

This section describes the classes and methods that will be implemented in this project. Figure 2.2 displays a class diagram for the Course Shopper. StudentProfile contains a list of semesters that have information on what classes a student took during a particular season and year. StudentProfile also contains a list of CourseDesignations which contain a class the student has taken and its corresponding course status (taken, taking, passed, grade received). DegreeProgram contains the name of a degree and the courses required to meet that degree. Curriculum contains a list of all classes that are available to be taken.

Figure 2.2 - Course Schedule Class Diagram – This shows the dependencies and has-a relationships between the objects implemented and used in the Course Shopper project.

CourseShopper: Contains the main function and overall GUI interface. Controls basic interface aspects.

CourseShopper
GUI parameters omitted
-m_loadedProfile: StudentProfile
-m_loadedCurriculum: Curriculum
-m_loadedDegree: DegreeProgram
GUI call-back methods omitted
DetermineUserRole(): void
InitialStudentPrompt(): void
InitialAdministratorPrompt(): void
InputPassword(): boolean

StudentProfile: Contains the user data on classes and it contains the CourseDesignation class as well as the Semester class.

StudentProfile
-m_name: String
-m_majors: Vector <string>
-m_minors: Vector <string>
-m_courses: Vector <CourseDesignation>
-m_plans: Vector <Semester>
-m_numCredits: int
DeclareMajor (String major): void
DeclareMinor (String minor): void
RemoveMajor(String major): void
RemoveMinor(String minor): void
GetCourseDesignationList():Vector<String>
GetCourseDesignation (String cID): CourseDesignation
GetTransferCourses(): Vector<String>
WhichSeason(String cID): int
WhichYear(String cID): int
AddCourse ( String cID, int status): void
AddCourse ( String cID, int season, int year, int status ): void
RemoveFromPlans(String cID): void
AddToPlans(CourseDesignation cd, int season, int year): void
GetTranscript(‘flags’): string
MeetsReq ( CourseRequirement req, int season, int year ): boolean
MeetsReq ( List<CourseRequirement> req, int season, int year ): boolean
PassesClasses( List<String> req, int season, int year, int status): String
PassesGFR( String GFR, int season, int year, int num): int
CheckPreReqs ( Course c, int season, int year ): boolean
GetNumCredits(void): int
WriteToFile(String fileName): void
toString(): String

Curriculum: Contains a list of all courses offered, as well as the ability to add new courses.

Curriculum
-m_offeredCourses: Vector<Course>
-m_dept: String
AddCourse (Course newCourse): void
RemoveCourse(String courseName): void
GetCourse(String cID): Course
GetClassNames(): List<String>
WriteToFile(String fileName): void
toString(): String

DegreeProgram: Contains a list of necessary courses, appropriate electives, and the gateway needed to earn a degree, as well as the ability to add and edit requirements.

Degree Program
-m_dept: String
-m_degreeType: String
-m_requirements: Vector<CourseRequirement>
-m_numElectives: int
-m_electives: Vector<CourseRequirement>
-m_gateway: Vector<CourseRequirement>
RemoveCourse(String cID): void
AddGateway(String cID, int gradeNeeded): void
AddGateway(String cID): void
AddRequirement(String cID, int gradeNeeded): void
AddRequirement(String cID): void
AddElective(String cID, int minGrade): void
AddElective(String cID): void
IsGatewayCourse(String cID): boolean
WriteToFile(String fileName): void
FindCourse(String cID): boolean
toString(): String

CourseDesignation: Contains a single course and two integer values, designating the course as taken, taking, untaken, planned, transfer, and grade.

CourseDesignation
-m_course: String
-m_grade: int
Contains no prominent functions. (functions other than mutators and accessors)

Course: Represents a single class with no particular association with any student profile, curriculum, or degree. Contains the name of the class, what department it belongs to, its course number, the number of credits worth, and the prerequisite courses.

Course
-m_dept: String
-m_cNum: String
-m_name: String
-m_credits: int
-m_prereq: List<String>
-m_desc: String
Contains no prominent functions. (functions other than mutators and accessors)

Semester: Represents a students past, current, or planned school semester. Contains two integers: one represents the season (Spring, Summer, Fall, Winter) and the other the year. Also contains a list of courses which a student has, is, or may enroll in.

Semester
-m_season: int
-m_year: int
-m_courses: ArrayList<CourseDesignation>
AddCourse ( CourseDesignation course ): void
PrevSemester(): Semester
PrevSubSemester(): Semester
NextSemester(): Semester
NextSubSemester(): Semester
ChangeSemester ( int season, int year ): void
Past(int season, int year): boolean
equals (int season, int year): boolean
toString(): String
toFile(): String
SeasonVal(String season): int

CourseRequirement: Responsible for keeping track of the minimum grade requirement

for the student to get credit for the course in a certain degree program.

CourseRequirement
-m_course: string
-m_minGrade: int
Contains no prominent functions. (functions other than mutators and accessors)


Mediator: This class handles all interactions between a student profile, curriculums, and degree programs so that those three objects are abstracted from the main class.

Mediator
-m_sp: StudentProfile
-m_currs: HashMap<String, Curriculum>
-m_degs: HashMap<String, DegreeProgram>
Reset(): void
SetGFR(String file): void
WhichSeason(String cID): int
WhichYear(String cID): String
UpdateCurriculumIndex(String index): void
DeclareDegree(String deg): void
RemoveDegree(String deg): void
GetUnmetRequirements(String degName, int season, int year):
List<CourseRequirement>
GetUnmetRequirementsString(String degName): String
PassesGateway(String degName, int season, int year): boolean
NumNeededElectives(String degName, int season, int year): int
AddCourseToStudentPlans(String cID, int season, int year, int grade): void
AddCourseToCurriculum(String currName, Course newCourse): void
RemoveCourseFromCurriculum(String currName): void
CanTake(String cID, int season, int year, int status): String
Transcript(): String
CourseDesignationForTranscript(CourseDesignation cd): String
GradeLetter(int grade): String
AvailableCourses(): Vector<String>
SaveCurrToFile(String currName): void
SaveProfileToFile(): void
ExportProfile(): void