yi-kiat / ICT2106_P3-5

MIT License
0 stars 0 forks source link

[D2] 4.1 Principle 1 #69

Closed gohguanlin closed 1 year ago

gohguanlin commented 1 year ago

TODO: Principle 1 of SOLID principle.

To be completed on

gohguanlin commented 1 year ago

Identified Single Responsibility Principle violated for my QuarterlyReport Class. Currently QuarterlyReport Controller is responsible for mainly:

  1. Pulling project progress data via iProgress interface from M2.
  2. Compiling data for project progress.
  3. Perform data analysis on compiled data.
  4. Generation of report.

Therefore there are 4 reasons to change if modifications is required in the class:

  1. Ways to interface or format of data from M2
  2. Ways or timeframe to compile progress data (Quarterly to Annual)
  3. Metrics/algorithm change on how analysis is performed
  4. Different format or output is required to be changed

As a result, the responsibilities should be split into 4 different classes namely:

DataProvider

Image

DataCompiler

Image

DataAnalysis

Image

ReportGenerator

Image

gohguanlin commented 1 year ago

Amended class diagram for QuarterlyReport. The new classes are split according to their responsibilities.

Image

Reviewed and acknowledged by team members:

jiaxinlarhh commented 1 year ago

Completed and closed on 16/3