开发者

Design a Student-Course-Teacher-Semester spreadsheet

开发者 https://www.devze.com 2023-03-21 03:14 出处:网络
Recently I was asked to design for curriculum application (in Jav开发者_JS百科a) model dealing with Student/Teacher/Semester/Course entities. It is something like spreadsheet design problem.


Recently I was asked to design for curriculum application (in Jav开发者_JS百科a) model dealing with Student/Teacher/Semester/Course entities. It is something like spreadsheet design problem.

The condition was: a student can enroll for a course, taught by some teacher, for a semester occurring at a particular time, say at semester-2.

A student may have multiple courses, taught by multiple teachers (each teacher teaches a specific course) at multiple time (each course occurs at an unique semester). Thus the combination of student + course + teacher+ semester is unique.

What will be a smarter design?

I initially started with a class having student id and a Map where the map has 'key' value set to Course-id and 'value' set to another class, say TeacherSemester. The TeacherSemesterclass contains the TeacherId and SemesterId values.

But this does not seem to be a scalable solution. Can anyone suggest a better design? Any discussion will be helpful.

Thaks


Teacher and Student are roles, they aren't classes.

class Person
{
    string Name
}
class Course
{
    List<Person> enrolledStudents
    List<Person> teachers
    Semester semester
    CourseTime time
}
class Application
{
    List<Course> courses
    List<Person> persons
    List<Semesters> semester
    List<CourseTime> courseTimes
}
0

精彩评论

暂无评论...
验证码 换一张
取 消