vendredi 27 octobre 2017

What design patterns are available for Data Classes in Java?

I have a complex class in Java whose responsibility it to mainly store Data. I was wondering if there are any design patterns available to guide such use cases. To be more specific, the class is something which records the overall performance of a student per semester.

Class StudentReport{
    cgpa = 3.1;
    Set <SubjectReport> perSubjectReportSet;
    overallFeedback = "..."
    ...
}

Class SubjectReport{
   subjectName = "Subject_A";
   gpa = 2.4;

   // Test Details
   test = Pass;
   testQuestionAnsweredCount = 8;
   testQuestionsCount = 10;
   testFeedback = None; // Feedback if FAIL

   // Assignment Details
   assignment = Pass;
   ...

   //Exam Details
   finalExam = Fail;
   examQuestionAnsweredCount = 5;
   examCorrectlyAnsweredQuestionCount = 2;
   examQuestionsCount = 10;
   examFeedback = "Blah Blah OOP" // Feedback if FAIL
}

Aucun commentaire:

Enregistrer un commentaire