# ashbornhater/oop architecture

> Architecture diagram of the GitHub repository ashbornhater/oop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashbornhater/oop
- Repository: https://github.com/ashbornhater/oop

## Overview

This coursework repository contains three independent Java assignments: a console banking exercise, a shape-calculator exercise, and a Swing vending-machine GUI. Their user-to-result flows are separate: banking users authenticate before managing an account; calculator users choose a shape and see its calculated information; vending-machine customers browse products and confirm purchases, while an admin entry point exposes inventory management. The excerpts show the GUI’s purchase and stock-update behavior, but not all admin dispatch or image-loading details, so those relationships are omitted.

Main entry points: [`Inheritance&Polymorphism/Main.java`](https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Main.java) (Calculator Menu), [`VendingMachineGUI/VendingMachineGUI.java`](https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java) (Purchase Handler), [`Array&ArrayList/Main.java`](https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/Main.java) (Bank Console Flow), [`Array&ArrayList/BankAccount.java`](https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/BankAccount.java) (Bank Account)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_banking["Banking Assignment"]
  node_bank_main["Bank Console Flow<br/>[Main.java]"]
  node_auth["Authentication<br/>[Auth.java]"]
  node_account["Bank Account<br/>[BankAccount.java]"]
  node_bank["Balance Operations<br/>[Bank.java]"]
end

subgraph group_shapes["Shape Calculator"]
  node_shape_main["Calculator Menu<br/>[Main.java]"]
  node_shape_base["Shape Base<br/>[Bentuk.java]"]
  node_square["Square<br/>[BujurSangkar.java]"]
  node_circle_shape["Circle<br/>[Lingkaran.java]"]
  node_cylinder["Cylinder<br/>[Silinder.java]"]
end

subgraph group_vending["Vending Machine"]
  node_vending_app["Swing Application"]
  node_catalog["Product Catalog UI"]
  node_purchase["Purchase Handler"]
  node_inventory[("In-Memory Inventory")]
  node_admin["Admin Entry"]
  node_sound["Purchase Sound<br/>[vmSound.wav]"]
end

node_bank_user(("Bank User"))
node_shape_user(("Calculator User"))
node_vending_user(("Vending Customer"))

node_bank_user -->|"uses"| node_bank_main
node_bank_main -->|"routes to"| node_auth
node_bank_main -->|"creates and transacts"| node_account
node_auth -->|"validates and creates"| node_account
node_account -->|"extends"| node_bank
node_shape_user -->|"uses"| node_shape_main
node_shape_main -->|"creates"| node_square
node_shape_main -->|"creates"| node_circle_shape
node_shape_main -->|"creates"| node_cylinder
node_square -->|"extends"| node_shape_base
node_circle_shape -->|"extends"| node_shape_base
node_cylinder -->|"extends"| node_circle_shape
node_vending_user -->|"interacts"| node_vending_app
node_vending_app -->|"renders"| node_catalog
node_catalog -->|"dispatches purchase"| node_purchase
node_purchase -->|"decrements stock"| node_inventory
node_purchase -->|"refreshes"| node_catalog
node_purchase -->|"plays"| node_sound
node_vending_app -->|"opens login"| node_admin
node_admin -->|"updates stock"| node_inventory

click node_bank_main "https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/Main.java"
click node_auth "https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/Auth.java"
click node_account "https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/BankAccount.java"
click node_bank "https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/Bank.java"
click node_shape_main "https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Main.java"
click node_shape_base "https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Bentuk.java"
click node_square "https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/BujurSangkar.java"
click node_circle_shape "https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Lingkaran.java"
click node_cylinder "https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Silinder.java"
click node_vending_app "https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java"
click node_catalog "https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java"
click node_purchase "https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java"
click node_inventory "https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java"
click node_admin "https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java"
click node_sound "https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/Assets/vmSound.wav"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bank_main,node_auth,node_account,node_bank,node_bank_user,node_shape_user toneBlue
class node_shape_main,node_shape_base,node_square,node_circle_shape,node_cylinder toneAmber
class node_vending_app,node_catalog,node_purchase,node_inventory,node_admin,node_sound toneMint
class node_vending_user toneIndigo
```

## Components

### Banking Assignment

- [Bank Console Flow](https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/Main.java): `Array&ArrayList/Main.java`
- [Authentication](https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/Auth.java): `Array&ArrayList/Auth.java`
- [Bank Account](https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/BankAccount.java): `Array&ArrayList/BankAccount.java`
- [Balance Operations](https://github.com/ashbornhater/oop/blob/main/Array%26ArrayList/Bank.java): `Array&ArrayList/Bank.java`

### Shape Calculator

- [Calculator Menu](https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Main.java): `Inheritance&Polymorphism/Main.java`
- [Shape Base](https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Bentuk.java): `Inheritance&Polymorphism/Bentuk.java`
- [Square](https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/BujurSangkar.java): `Inheritance&Polymorphism/BujurSangkar.java`
- [Circle](https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Lingkaran.java): `Inheritance&Polymorphism/Lingkaran.java`
- [Cylinder](https://github.com/ashbornhater/oop/blob/main/Inheritance%26Polymorphism/Silinder.java): `Inheritance&Polymorphism/Silinder.java`

### Vending Machine

- [Swing Application](https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java): `VendingMachineGUI/VendingMachineGUI.java`
- [Product Catalog UI](https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java): `VendingMachineGUI/VendingMachineGUI.java`
- [Purchase Handler](https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java): `VendingMachineGUI/VendingMachineGUI.java`
- [In-Memory Inventory](https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java): `VendingMachineGUI/VendingMachineGUI.java`
- [Admin Entry](https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/VendingMachineGUI.java): `VendingMachineGUI/VendingMachineGUI.java`
- [Purchase Sound](https://github.com/ashbornhater/oop/blob/main/VendingMachineGUI/Assets/vmSound.wav): `VendingMachineGUI/Assets/vmSound.wav`

### Other components

- **Bank User**
- **Calculator User**
- **Vending Customer**

## Connections

- Bank User → Bank Console Flow: uses (evidence: `README.md`)
- Bank Console Flow → Authentication: routes to (evidence: `Array&ArrayList/Main.java`)
- Bank Console Flow → Bank Account: creates and transacts (evidence: `Array&ArrayList/Main.java`)
- Authentication → Bank Account: validates and creates (evidence: `Array&ArrayList/Auth.java`)
- Bank Account → Balance Operations: extends (evidence: `Array&ArrayList/BankAccount.java`)
- Calculator User → Calculator Menu: uses (evidence: `README.md`)
- Calculator Menu → Square: creates (evidence: `Inheritance&Polymorphism/Main.java`)
- Calculator Menu → Circle: creates (evidence: `Inheritance&Polymorphism/Main.java`)
- Calculator Menu → Cylinder: creates (evidence: `Inheritance&Polymorphism/Main.java`)
- Square → Shape Base: extends (evidence: `Inheritance&Polymorphism/BujurSangkar.java`)
- Circle → Shape Base: extends (evidence: `Inheritance&Polymorphism/Lingkaran.java`)
- Cylinder → Circle: extends (evidence: `Inheritance&Polymorphism/Silinder.java`)
- Vending Customer → Swing Application: interacts (evidence: `VendingMachineGUI/VendingMachineGUI.java`)
- Swing Application → Product Catalog UI: renders (evidence: `VendingMachineGUI/VendingMachineGUI.java`)
- Product Catalog UI → Purchase Handler: dispatches purchase (evidence: `VendingMachineGUI/VendingMachineGUI.java`)
- Purchase Handler → In-Memory Inventory: decrements stock (evidence: `VendingMachineGUI/VendingMachineGUI.java`)
- Purchase Handler → Product Catalog UI: refreshes (evidence: `VendingMachineGUI/VendingMachineGUI.java`)
- Purchase Handler → Purchase Sound: plays (evidence: `VendingMachineGUI/VendingMachineGUI.java`)
- Swing Application → Admin Entry: opens login (evidence: `VendingMachineGUI/VendingMachineGUI.java`)
- Admin Entry → In-Memory Inventory: updates stock (evidence: `VendingMachineGUI/VendingMachineGUI.java`)
