Skip to content

Commit

Permalink
Merge pull request #94 from ngeeyonglim/edit-developerguide
Browse files Browse the repository at this point in the history
Edit developerguide
  • Loading branch information
Cikguseven authored Oct 24, 2023
2 parents 38baca2 + d1102ed commit 51fc593
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 0 deletions.
69 changes: 69 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,75 @@ _{more aspects and alternatives to be added}_

_{Explain here how the data archiving feature will be implemented}_

### \[Proposed\] Class Details feature

#### Proposed Implementation

The proposed class details mechanism for each student will be facilitated by `ClassDetails`. It allows for the tracking
of an `Student` 's class details, such as their tutorial group, tutorial attendance, class participation, and assignment
grades. It will be stored as 3 separate classes to model each of the 3 different types of class details, and a tracker
class to act as the manager for each of the classes, with the trackers composing the `ClassDetails` class.

<puml src="diagrams/ClassDetails.puml" width="250" />

The 3 different types of class grades are:

* `Attendance` - Stores the details for a students attendance in a specific tutorial. Attendance will be stored as
a boolean value.
* `ClassParticipation` - Stores the details for a students participation in a specific tutorial. Class participation
will be stored as a boolean value.
* `Assignment` - Stores the details for a students assignment grades for a specific tutorial. Assignment grades will be
stored as an integer value, with the total marks standardized to 100 marks.

<puml src="diagrams/ClassGrades.puml" width="250" />

These classes will be stored in their respective tracker classes, using Java Arrays to store the objects. The position
of the classes in the array will correspond to the index of the tutorial or assignment. For example, the first index of
the array will correspond to either the first tutorial or assignment, depending on the tracker class.

The tracker classes will be stored in the `ClassDetails` class, which will be composed of the following classes:
* `AttendanceTracker` - Stores the `Attendance` objects for a specific student.
* `ClassParticipationTracker` - Stores the `ClassParticipation` objects for a specific student.
* `AssignmentTracker` - Stores the `Assignment` objects for a specific student.

* <puml src="diagrams/Tracker.puml" width="250" />

These tracker classes will inherit from a `tracker` *interface*. They will also support the following operations:
* `getPercentage()` - Returns the average grade of the student for the specific tracker class. For example, the average
tutorial attendance percentage, or the average assignment score.

Each of these tracker classes will be able to be initialized with a specific size, which will be the number of tutorials
or assignment grade.

#### Design considerations:

**Aspect: Class grades classes**

* **Alternative 1 (current choice):** Use a class for each type of class details.
* Pros: Easy to implement, follows OOP principle. If we want to edit the implementation of each of the classes or
change the data structure / details of each instance, it can be easily done.
* Cons: May have performance issues in terms of memory usage.

* **Alternative 2:** Store class values as a primitive type (String or Integer).
* Pros: Will use less memory.
* Cons: We must ensure that the implementation of each individual class are correct. Implementation will be more
complicated as different class detail types will require different implementations for the same operation.

**Aspect: Tracker classes**

* **Alternative 1 (current choice):** Use a tracker class for each type of class details.
* Pros: Easy to implement. Shared functions can be abstracted out and polymorphism can be applied.
* Cons: May have performance issues in terms of memory usage.

* **Alternative 2:** Store class values as an Object Array.
* Pros: Will use less memory.
* Cons: Will need to implement different functions for each type of class details. Implementation will be more
complicated. SLAP principle might not be able to be adhered to.






--------------------------------------------------------------------------------------------------------------------

Expand Down
23 changes: 23 additions & 0 deletions docs/diagrams/ClassDetails.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor LOGIC_COLOR_T4
skinparam classBackgroundColor LOGIC_COLOR

package Trackers as TrackerPackage {
Class "<<interface>>\nTracker" as Tracker
Class Tracker
Class AttendanceTracker
Class AssignmentTracker
Class ClassParticipationTracker
}

AttendanceTracker .up.|> Tracker
AssignmentTracker .up.|> Tracker
ClassParticipationTracker .up.|> Tracker

AttendanceTracker --* ClassDetails
AssignmentTracker --* ClassDetails
ClassParticipationTracker --* ClassDetails

@enduml
29 changes: 29 additions & 0 deletions docs/diagrams/ClassGrades.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor LOGIC_COLOR_T4
skinparam classBackgroundColor LOGIC_COLOR

package Trackers as TrackerPackage {
Class "<<interface>>\nTracker" as Tracker
Class Tracker
Class AttendanceTracker
Class AssignmentTracker
Class ClassParticipationTracker
}

package ClassGrades as ClassGradesPackage {
Class Attendance
Class Assignment
Class ClassParticipation
}

AttendanceTracker .up.|> Tracker
AssignmentTracker .up.|> Tracker
ClassParticipationTracker .up.|> Tracker

Attendance --* AttendanceTracker
Assignment --* AssignmentTracker
ClassParticipation --* ClassParticipationTracker

@enduml
30 changes: 30 additions & 0 deletions docs/diagrams/Trackers.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor LOGIC_COLOR_T4
skinparam classBackgroundColor LOGIC_COLOR

package Trackers as TrackerPackage {
Class "<<interface>>\nTracker" as Tracker
Class Tracker
Class AttendanceTracker
Class AssignmentTracker
Class ClassParticipationTracker
}

package ClassGrades as ClassGradesPackage {
Class Attendance
Class Assignment
Class ClassParticipation
}

AttendanceTracker .up.|> Tracker
AssignmentTracker .up.|> Tracker
ClassParticipationTracker .up.|> Tracker

Attendance --* AttendanceTracker
Assignment --* AssignmentTracker
ClassParticipation --* ClassParticipationTracker


@enduml

0 comments on commit 51fc593

Please sign in to comment.