You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/DeveloperGuide.adoc
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -521,6 +521,44 @@ The editedStudent will have the new programming language attribute and will henc
521
521
** Cons: User will have to learn a new specific command and might also be slightly difficult to implement.
522
522
// end::programmingLanguage[]
523
523
524
+
// tag::schedule[]
525
+
=== Schedule feature
526
+
==== Current Implementation
527
+
528
+
To get better control of one's weekly schedule, we will now attach a component called `Schedule` to `Model`.
529
+
530
+
image::ScheduleClassDiagram.png[width="800"]
531
+
532
+
A `Schedule` is a list of `Lessons`. A `Lesson` has a `Student` attribute, a `Day` attribute, a starting `TIME START_TIME` and an ending `TIME END_TIME` attribute
533
+
534
+
* A `Lesson` object called `newLesson` will be created by `ModelManager.addLesson(Student, Day, Time START_TIME, Time END_TIME)`, which is implemented as such:
535
+
[source, java]
536
+
----
537
+
public void addLesson(Student studentToAddLesson, Day day, Time startTime, Time endTime)
//Check for Duplicate Lesson, StudentNotFound, invalid input ime
540
+
541
+
schedule.addLesson(newLesson);
542
+
}
543
+
----
544
+
545
+
The student will be selected by the Index of the last seen list of students. A new `Lesson` will now be added for that student at the specific `Day`, `START_TIME` and `END_TIME`.
546
+
547
+
[NOTE]
548
+
If you have a future implementation that requires the addition of a new attribute in the `Schedule` class, you must take note of updating the `Model.addLesson(Student, Day, Time START_TIME, Time END_TIME)` method to reflect the new attribute.
549
+
550
+
==== Design Considerations
551
+
552
+
===== Aspect: Implementation of `Schedule`
553
+
* *Alternative 1 (current choice)*: `Schedule` contains `Lesson` classes that is made up of one layer, with attributes directly attached to `Lesson`
554
+
** Pro: It is easier implement, just add `Lesson` to a `Schedule`, which is a list of `Lessons`
555
+
** Con: Results in more coupling, attributes could have been furthur separated out. It is inefficient to search by `Day`. Searching for empty slot requires linear searching.
556
+
* *Alternative 2*: `Lesson` contains two layers of classes, `Day` is attached to `Schedule` and `Lesson` is attached to `Day`
557
+
** Pro: Less coupling and more cohesive design
558
+
** Con: Much harder to implement and gets overly complicated
559
+
560
+
// end::schedule[]
561
+
524
562
=== Logging
525
563
526
564
We are using `java.util.logging` package for logging. The `LogsCenter` class is used to manage the logging levels and logging destinations.
0 commit comments