# qoshima/logistics architecture

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

- Interactive diagram: https://gitdiagram.com/qoshima/logistics
- Repository: https://github.com/qoshima/logistics

## Overview

This is a small Java console demo of two creational patterns: choosing a delivery mode creates a road or sea logistics strategy, while choosing a platform creates a matching UI component family. Main validates choices and constructs the application; DeliveryApplication paints the UI and delegates delivery planning. The graph shows the documented workflow and pattern implementations; relationships are based on the README and indexed source references, with no external services or persistent state.

Main entry points: [`src/app/Main.java`](https://github.com/qoshima/logistics/blob/main/src/app/Main.java) (Input and selection), [`src/app/DeliveryApplication.java`](https://github.com/qoshima/logistics/blob/main/src/app/DeliveryApplication.java) (Delivery application), [`src/gui/windows/WindowsFactory.java`](https://github.com/qoshima/logistics/blob/main/src/gui/windows/WindowsFactory.java) (Windows factory), [`src/gui/macos/MacOSFactory.java`](https://github.com/qoshima/logistics/blob/main/src/gui/macos/MacOSFactory.java) (macOS factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["Input and selection<br/>[Main.java]"]
  node_delivery_app["Delivery application"]
end

subgraph group_gui["Platform UI"]
  node_gui_factory["UI factory interface<br/>[GUIFactory.java]"]
  node_button["Button interface<br/>[Button.java]"]
  node_checkbox["Checkbox interface<br/>[Checkbox.java]"]
  node_windows_factory["Windows factory"]
  node_windows_button["Windows button<br/>[WindowsButton.java]"]
  node_windows_checkbox["Windows checkbox"]
  node_mac_factory["macOS factory<br/>[MacOSFactory.java]"]
  node_mac_button["macOS button<br/>[MacOSButton.java]"]
  node_mac_checkbox["macOS checkbox<br/>[MacOSCheckbox.java]"]
end

subgraph group_transport["Delivery"]
  node_logistics["Logistics planner<br/>[Logistics.java]"]
  node_road_logistics["Road logistics<br/>[RoadLogistics.java]"]
  node_sea_logistics["Sea logistics<br/>[SeaLogistics.java]"]
  node_transport["Transport interface<br/>[Transport.java]"]
  node_truck["Truck delivery<br/>[Truck.java]"]
  node_ship["Ship delivery<br/>[Ship.java]"]
end

node_user(("Console user"))

node_user -->|"enters choices"| node_main
node_main -->|"constructs and runs"| node_delivery_app
node_main -->|"selects road"| node_road_logistics
node_main -->|"selects sea"| node_sea_logistics
node_main -->|"selects Windows"| node_windows_factory
node_main -->|"selects macOS"| node_mac_factory
node_delivery_app -->|"creates components through"| node_gui_factory
node_delivery_app -->|"paints"| node_button
node_delivery_app -->|"paints"| node_checkbox
node_delivery_app -->|"plans delivery through"| node_logistics
node_windows_factory -->|"creates"| node_windows_button
node_windows_factory -->|"creates"| node_windows_checkbox
node_mac_factory -->|"creates"| node_mac_button
node_mac_factory -->|"creates"| node_mac_checkbox
node_logistics -->|"creates and delivers via"| node_transport
node_road_logistics -->|"creates"| node_truck
node_sea_logistics -->|"creates"| node_ship
node_truck -->|"implements"| node_transport
node_ship -->|"implements"| node_transport
node_windows_button -->|"implements"| node_button
node_windows_checkbox -->|"implements"| node_checkbox
node_mac_button -->|"implements"| node_button
node_mac_checkbox -->|"implements"| node_checkbox

click node_main "https://github.com/qoshima/logistics/blob/main/src/app/Main.java"
click node_delivery_app "https://github.com/qoshima/logistics/blob/main/src/app/DeliveryApplication.java"
click node_gui_factory "https://github.com/qoshima/logistics/blob/main/src/gui/GUIFactory.java"
click node_button "https://github.com/qoshima/logistics/blob/main/src/gui/Button.java"
click node_checkbox "https://github.com/qoshima/logistics/blob/main/src/gui/Checkbox.java"
click node_windows_factory "https://github.com/qoshima/logistics/blob/main/src/gui/windows/WindowsFactory.java"
click node_windows_button "https://github.com/qoshima/logistics/blob/main/src/gui/windows/WindowsButton.java"
click node_windows_checkbox "https://github.com/qoshima/logistics/blob/main/src/gui/windows/WindowsCheckbox.java"
click node_mac_factory "https://github.com/qoshima/logistics/blob/main/src/gui/macos/MacOSFactory.java"
click node_mac_button "https://github.com/qoshima/logistics/blob/main/src/gui/macos/MacOSButton.java"
click node_mac_checkbox "https://github.com/qoshima/logistics/blob/main/src/gui/macos/MacOSCheckbox.java"
click node_logistics "https://github.com/qoshima/logistics/blob/main/src/transport/Logistics.java"
click node_road_logistics "https://github.com/qoshima/logistics/blob/main/src/transport/RoadLogistics.java"
click node_sea_logistics "https://github.com/qoshima/logistics/blob/main/src/transport/SeaLogistics.java"
click node_transport "https://github.com/qoshima/logistics/blob/main/src/transport/Transport.java"
click node_truck "https://github.com/qoshima/logistics/blob/main/src/transport/Truck.java"
click node_ship "https://github.com/qoshima/logistics/blob/main/src/transport/Ship.java"

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_main,node_delivery_app,node_user toneBlue
class node_gui_factory,node_button,node_checkbox,node_windows_factory,node_windows_button,node_windows_checkbox,node_mac_factory,node_mac_button,node_mac_checkbox toneAmber
class node_logistics,node_road_logistics,node_sea_logistics,node_transport,node_truck,node_ship toneMint
```

## Components

### Application

- [Input and selection](https://github.com/qoshima/logistics/blob/main/src/app/Main.java): `src/app/Main.java`
- [Delivery application](https://github.com/qoshima/logistics/blob/main/src/app/DeliveryApplication.java): `src/app/DeliveryApplication.java`

### Platform UI

- [UI factory interface](https://github.com/qoshima/logistics/blob/main/src/gui/GUIFactory.java): `src/gui/GUIFactory.java`
- [Button interface](https://github.com/qoshima/logistics/blob/main/src/gui/Button.java): `src/gui/Button.java`
- [Checkbox interface](https://github.com/qoshima/logistics/blob/main/src/gui/Checkbox.java): `src/gui/Checkbox.java`
- [Windows factory](https://github.com/qoshima/logistics/blob/main/src/gui/windows/WindowsFactory.java): `src/gui/windows/WindowsFactory.java`
- [Windows button](https://github.com/qoshima/logistics/blob/main/src/gui/windows/WindowsButton.java): `src/gui/windows/WindowsButton.java`
- [Windows checkbox](https://github.com/qoshima/logistics/blob/main/src/gui/windows/WindowsCheckbox.java): `src/gui/windows/WindowsCheckbox.java`
- [macOS factory](https://github.com/qoshima/logistics/blob/main/src/gui/macos/MacOSFactory.java): `src/gui/macos/MacOSFactory.java`
- [macOS button](https://github.com/qoshima/logistics/blob/main/src/gui/macos/MacOSButton.java): `src/gui/macos/MacOSButton.java`
- [macOS checkbox](https://github.com/qoshima/logistics/blob/main/src/gui/macos/MacOSCheckbox.java): `src/gui/macos/MacOSCheckbox.java`

### Delivery

- [Logistics planner](https://github.com/qoshima/logistics/blob/main/src/transport/Logistics.java): `src/transport/Logistics.java`
- [Road logistics](https://github.com/qoshima/logistics/blob/main/src/transport/RoadLogistics.java): `src/transport/RoadLogistics.java`
- [Sea logistics](https://github.com/qoshima/logistics/blob/main/src/transport/SeaLogistics.java): `src/transport/SeaLogistics.java`
- [Transport interface](https://github.com/qoshima/logistics/blob/main/src/transport/Transport.java): `src/transport/Transport.java`
- [Truck delivery](https://github.com/qoshima/logistics/blob/main/src/transport/Truck.java): `src/transport/Truck.java`
- [Ship delivery](https://github.com/qoshima/logistics/blob/main/src/transport/Ship.java): `src/transport/Ship.java`

### Other components

- **Console user**

## Connections

- Console user → Input and selection: enters choices (evidence: `src/app/Main.java`)
- Input and selection → Delivery application: constructs and runs (evidence: `src/app/Main.java`)
- Input and selection → Road logistics: selects road (evidence: `src/app/Main.java`)
- Input and selection → Sea logistics: selects sea (evidence: `src/app/Main.java`)
- Input and selection → Windows factory: selects Windows (evidence: `src/app/Main.java`)
- Input and selection → macOS factory: selects macOS (evidence: `src/app/Main.java`)
- Delivery application → UI factory interface: creates components through (evidence: `src/app/DeliveryApplication.java`)
- Delivery application → Button interface: paints (evidence: `src/app/DeliveryApplication.java`)
- Delivery application → Checkbox interface: paints (evidence: `src/app/DeliveryApplication.java`)
- Delivery application → Logistics planner: plans delivery through (evidence: `src/app/DeliveryApplication.java`)
- Windows factory → Windows button: creates (evidence: `src/gui/windows/WindowsFactory.java`)
- Windows factory → Windows checkbox: creates (evidence: `src/gui/windows/WindowsFactory.java`)
- macOS factory → macOS button: creates (evidence: `src/gui/macos/MacOSFactory.java`)
- macOS factory → macOS checkbox: creates (evidence: `src/gui/macos/MacOSFactory.java`)
- Logistics planner → Transport interface: creates and delivers via (evidence: `src/transport/Logistics.java`)
- Road logistics → Truck delivery: creates (evidence: `src/transport/RoadLogistics.java`)
- Sea logistics → Ship delivery: creates (evidence: `src/transport/SeaLogistics.java`)
- Truck delivery → Transport interface: implements (evidence: `src/transport/Truck.java`)
- Ship delivery → Transport interface: implements (evidence: `src/transport/Ship.java`)
- Windows button → Button interface: implements (evidence: `src/gui/windows/WindowsButton.java`)
- Windows checkbox → Checkbox interface: implements (evidence: `src/gui/windows/WindowsCheckbox.java`)
- macOS button → Button interface: implements (evidence: `src/gui/macos/MacOSButton.java`)
- macOS checkbox → Checkbox interface: implements (evidence: `src/gui/macos/MacOSCheckbox.java`)
