# kyrillosmaher/university_java_labs architecture

> Architecture diagram of the GitHub repository kyrillosmaher/university_java_labs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kyrillosmaher/university_java_labs
- Repository: https://github.com/kyrillosmaher/university_java_labs

## Overview

This project is not a single monolithic application but rather a collection of independent Java lab assignments (and midterm exams) for what appears to be a university-level course (COMP 301). Each lab folder (Lab1, Lab2, …, Lab8, lab5, and the MIDTERMEXAM modules) contains its own self-contained source code, documentation (in the form of assignment sheets and README files), and sometimes compiled binaries. Although each lab solves a different assignment or implements different functionality (for example, Lab2 and Lab3 include "Author" and "Book" model classes; Lab6, Lab7, and others are grouped by questions), the overall structure is essentially modular – each lab is an independent module within a larger learning repository.

##### Main Components
- Top-Level Container: Represent the overall "University_Java_Labs" repository.
- Modules: Create a distinct component for each lab and exam (e.g., Lab1, Lab2, Lab3, Lab4, lab5, Lab6, Lab7, Lab8, MIDTERMEXAM2022, MIDTERMEXAM23). Each of these modules is a self-contained Java application.
- Within Each Module:
– Source Code (src): Indicate the presence of main drivers (e.g., Main.java, App.java) which act as entry points.
– Models Directory: Represent the domain classes (e.g., QuestionOne.java, Author.java, Car.java, etc.) that encapsulate business logic or data models.
– Configuration/IDE Files: Note the presence of .vscode directories (which are less architecturally relevant but indicate development environment configuration).

##### Relationships and Interactions
- For every lab module, map out:
– The flow from the entry point (e.g., App.java or Main.java) to the various model classes that it instantiates and manipulates.
– How helper utilities (if any) or secondary classes (for instance, utility methods in ArrayListSimulator or specialized classes in different question folders) are used by the main application driver.

##### Architectural Patterns and Design Principles
- Modular Design: Emphasize how each lab is self-contained with its own entry point and a set of model or utility classes.
- Layered Structure: Although simple, each module follows a basic layered structure where the main application (UI or main logic) interacts with the models (data representation). Explain this for labs that follow a clear procedural or object-oriented architecture.
- Educational Focus: Note that the purpose is to demonstrate core Java concepts and object-oriented programming principles rather than a sophisticated enterprise architecture.

##### Relevant Technologies, Frameworks, or Libraries
- Java is the primary programming language used across all labs.
- The presence of .vscode folders indicates that Visual Studio Code or a similar IDE might be in use.

##### Instructing the Principal Software Engineer
– Label “Lab1” and within it, indicate “Main.java” as the entrance and a cluster of “QuestionX” classes as the business logic.
– Label “Lab2” with its own “Lab2.java” and its “Models” (Author, Book, etc.), showing how the application likely simulates or manages a domain (like a library or book management system).
– Continue similarly for each lab.
– The control/data flow from the application driver to the model classes.
– Interdependencies (if any) within a module; for example, if one model uses or calls another model’s functions.
- Provide annotations where needed to describe:
– The purpose of each component.
– Any patterns (such as “MVC-like separation” though basic).
– The role of key files (e.g., assignment sheets and READMEs that provide context for each lab).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Repo["University_Java_Labs Repository"]:::repo
    Repo -->|"contains"| L1_EP
    Repo -->|"contains"| L2_EP
    Repo -->|"contains"| L3_EP
    Repo -->|"contains"| L4_EP
    Repo -->|"contains"| l5_EP
    Repo -->|"contains"| L6_EP
    Repo -->|"contains"| L7_EP
    Repo -->|"contains"| L8_EP
    Repo -->|"contains"| M2022_EP
    Repo -->|"contains"| M2023_EP

    subgraph "Lab1 Module"
        L1_EP["Main.java"]:::ep
        L1_models["Models"]:::model
        L1_EP -->|"instantiates"| L1_models
    end

    subgraph "Lab2 Module"
        L2_EP["Lab2.java"]:::ep
        L2_models["Models"]:::model
        L2_EP -->|"instantiates"| L2_models
    end

    subgraph "Lab3 Module"
        L3_EP["App.java"]:::ep
        L3_models["Models"]:::model
        L3_EP -->|"calls"| L3_models
    end

    subgraph "Lab4 Module"
        L4_EP["Lab4.java"]:::ep
        L4_models["Models"]:::model
        L4_EP -->|"interacts_with"| L4_models
    end

    subgraph "lab5 Module"
        l5_EP["App.java"]:::ep
        l5_models["Models"]:::model
        l5_EP -->|"utilizes"| l5_models
    end

    subgraph "Lab6 Module"
        L6_EP["App.java"]:::ep
        L6_Q1["QuestionOne"]:::question
        L6_Q2["QuestionTwo"]:::question
        L6_Q3["QuestionThree"]:::question
        L6_Q4["QuestionFour"]:::question
        L6_EP -->|"processes"| L6_Q1
        L6_EP -->|"processes"| L6_Q2
        L6_EP -->|"processes"| L6_Q3
        L6_EP -->|"processes"| L6_Q4
    end

    subgraph "Lab7 Module"
        L7_EP["App.java"]:::ep
        L7_Q1["QuestionOne"]:::question
        L7_Q2["QuestionTwo"]:::question
        L7_Q3["QuestionThree"]:::question
        L7_Q4["QuestionFour"]:::question
        L7_Q5["QuestionFive"]:::question
        L7_EP -->|"runs"| L7_Q1
        L7_EP -->|"runs"| L7_Q2
        L7_EP -->|"runs"| L7_Q3
        L7_EP -->|"runs"| L7_Q4
        L7_EP -->|"runs"| L7_Q5
    end

    subgraph "Lab8 Module"
        L8_EP["App.java"]:::ep
        L8_Array["ArrayListSimulator.java"]:::file
        L8_Drawing["Drawing.java"]:::file
        L8_Q1["Question1.java"]:::file
        L8_Q2["Question2.java"]:::file
        L8_Q3["Question3.java"]:::file
        L8_EP -->|"utilizes"| L8_Array
        L8_EP -->|"utilizes"| L8_Drawing
        L8_EP -->|"calls"| L8_Q1
        L8_EP -->|"calls"| L8_Q2
        L8_EP -->|"calls"| L8_Q3
    end

    subgraph "MIDTERMEXAM2022 Module"
        M2022_EP["App.java"]:::ep
        M2022_Contract["Contract.java"]:::model
        M2022_Employee["Employee.java"]:::model
        M2022_Permanent["Permanent.java"]:::model
        M2022_EP -->|"manages"| M2022_Contract
        M2022_EP -->|"manages"| M2022_Employee
        M2022_EP -->|"manages"| M2022_Permanent
    end

    subgraph "MIDTERMEXAM23 Module"
        M2023_EP["UniApp.java"]:::ep
        M2023_Course["Course.java"]:::model
        M2023_Staff["Staff.java"]:::model
        M2023_Student["Student.java"]:::model
        M2023_UserProfile["UserProfile.java"]:::model
        M2023_EP -->|"controls"| M2023_Course
        M2023_EP -->|"controls"| M2023_Staff
        M2023_EP -->|"controls"| M2023_Student
        M2023_EP -->|"controls"| M2023_UserProfile
    end

    %% Click Events
    click Repo "https://github.com/kyrillosmaher/university_java_labs/blob/main/."
    click L1_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab1/src/Main.java"
    click L1_models "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab1/src/Models"
    click L2_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab2/src/Lab2.java"
    click L2_models "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab2/src/Models"
    click L3_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab3/src/App.java"
    click L3_models "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab3/src/Models"
    click L4_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab4/src/Lab4/Lab4.java"
    click L4_models "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab4/src/Models"
    click l5_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/lab5/src/App.java"
    click l5_models "https://github.com/kyrillosmaher/university_java_labs/tree/main/lab5/src/Models"
    click L6_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab6/src/App.java"
    click L6_Q1 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab6/src/QuestionOne"
    click L6_Q2 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab6/src/QuestionTwo"
    click L6_Q3 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab6/src/QuestionThree"
    click L6_Q4 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab6/src/QuestionFour"
    click L7_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab7/src/App.java"
    click L7_Q1 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab7/src/QuestionOne"
    click L7_Q2 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab7/src/QuestionTwo"
    click L7_Q3 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab7/src/QuestionThree"
    click L7_Q4 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab7/src/QuestionFour"
    click L7_Q5 "https://github.com/kyrillosmaher/university_java_labs/tree/main/Lab7/src/QuestionFive"
    click L8_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab8/src/App.java"
    click L8_Array "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab8/src/ArrayListSimulator.java"
    click L8_Drawing "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab8/src/Drawing.java"
    click L8_Q1 "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab8/src/Question1.java"
    click L8_Q2 "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab8/src/Question2.java"
    click L8_Q3 "https://github.com/kyrillosmaher/university_java_labs/blob/main/Lab8/src/Question3.java"
    click M2022_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM2022/src/App.java"
    click M2022_Contract "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM2022/src/Contract.java"
    click M2022_Employee "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM2022/src/Employee.java"
    click M2022_Permanent "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM2022/src/Permanent.java"
    click M2023_EP "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM23/src/UniApp.java"
    click M2023_Course "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM23/src/Course.java"
    click M2023_Staff "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM23/src/Staff.java"
    click M2023_Student "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM23/src/Student.java"
    click M2023_UserProfile "https://github.com/kyrillosmaher/university_java_labs/blob/main/MIDTERMEXAM23/src/UserProfile.java"

    %% Styles
    classDef repo fill:#cce5ff,stroke:#0066cc,stroke-width:2px;
    classDef ep fill:#d4edda,stroke:#28a745,stroke-width:2px;
    classDef model fill:#fff3cd,stroke:#ffc107,stroke-width:2px;
    classDef question fill:#f8d7da,stroke:#dc3545,stroke-width:2px;
    classDef file fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
```
