-
Notifications
You must be signed in to change notification settings - Fork 2
Design
-The AutoGradeFacade class acts as a facade that provides a simplified interface to a more complex system of classes like UnzipUtility, GetUnzippedPaths, Copier, Compiler, and RunTest. It abstracts the complexity of interacting with these classes behind a single interface for grading purposes.
The Facade (AutoGradeFacade) abstracts the complexity of processing submissions (getSubmissionFolders), evaluating Java files (getReport), generating reports (generatePDf), and managing state (delete, resetState, emptyGarbage). This simplification aids in managing various tasks associated with grading and reporting.
Provides a single entry point for all operations required by the project's essential features. It hides the complexities of interaction with multiple subsystems and presents a simpler interface for the user to interact with.
All Classes Listed above descriptions on methods/fields/constructors can be found here!
- Utilized in the OverallReport class where it comprises multiple instances of Report implementations (PassengerReport, LuggageSlipReport, LuggageManifestReport, FlightReport).
Allows the OverallReport to aggregate and manage different types of reports uniformly, aiding in organizing and manipulating diverse reports generated from individual evaluations.
Provides a seamless way to manage and manipulate multiple Report instances, supporting various functionalities like aggregation and retrieval of test results across different types of reports.
All Classes Listed above descriptions on methods/fields/constructors can be found here!
- The ReportGeneratorTemplate provides a template method (generatePDF) with a predefined structure for generating reports. Subclasses (PDFGenerator and FailedReportPDFGenerator) implement specific steps of this algorithm but reuse the overall structure defined in the template.
The Template pattern ReportGeneratorTemplate ensures a consistent structure for generating reports while allowing subclasses to override specific steps. This uniformity helps in creating neatly formatted reports with various sections (createTable, createFailedTable, addRecommendationsTable) as specified by the project requirements.
All Classes Listed above descriptions on methods/fields/constructors can be found here!
1. Single Responsibility Principle (SRP):
All classes adhere to Single Responsibility Principle
2. Open/Closed Principle (OCP):
AbstractReport and its subclasses: They are open for extension (by creating new report types) but closed for modification, as they extend the abstract class without altering its existing behavior.
Facade interface: It defines methods for different grading functionalities, allowing for implementations that conform to these methods without modifying the interface itself.
Compiler Class: Open for extension by adding more files for compilation but closed for modification in terms of the existing logic.
PDFGenerator Class: Uses different methods for generating various sections of a PDF report, open for extension by adding new sections but closed for modification of the existing ones.
3. Liskov Substitution Principle (LSP):
AbstractReport and its subclasses: They follow the LSP by allowing instances of subclasses to be substituted for the base class Report without affecting the correctness of the program.
4. Interface Segregation Principle (ISP):
Facade interface: It segregates grading functionalities into distinct methods, ensuring that implementing classes only need to focus on the specific functionalities they require.
5. Dependency Inversion Principle (DIP):
Classes like AutoGradeFacade accept dependencies via constructor injection (e.g., OverallReport), adhering to DIP by relying on abstractions rather than concrete implementations.
- Multiple Principles
Template for PDF Generation: The PDF generation utilizes Liskov Substitution Principle (LSP) and Dependency Inversion Principle (DIP), indirectly aligning with Open/Closed Principle (OCP), LSP, and DIP. By conforming to one, it often aligns with others due to their interconnected nature in promoting extensibility, reusability, and flexibility.
