# niloofar-amirzadeh/thegreenestplanthotel architecture

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

- Interactive diagram: https://gitdiagram.com/niloofar-amirzadeh/thegreenestplanthotel
- Repository: https://github.com/niloofar-amirzadeh/thegreenestplanthotel

## Overview

The Greenest Plant Hotel is a small Swing desktop app for looking up daily watering needs. A user enters a plant name; the program checks a predefined set of plants, asks the matching plant for its liquid amount and type, and displays the result. The plant subclasses each implement their own calculation, while shared plant data and a liquid-type enum provide common structure. The excerpts show this main workflow and the domain relationships; no separate persistence or external service is documented.

Main entry points: [`src/TheGreenestPlantHotel/Main.java`](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Main.java) (Application flow), [`src/TheGreenestPlantHotel/Plant.java`](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Plant.java) (Plant base), [`src/TheGreenestPlantHotel/Cactus.java`](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Cactus.java) (Cactus), [`src/TheGreenestPlantHotel/LiquidType.java`](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/LiquidType.java) (Liquid types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_main["Application flow<br/>[Main.java]"]
end

subgraph group_plant_domain["Plant domain"]
  node_plant["Plant base<br/>[Plant.java]"]
  node_waterable["Waterable contract<br/>[Waterable.java]"]
  node_cactus["Cactus<br/>[Cactus.java]"]
  node_palm["Palm<br/>[Palm.java]"]
  node_carnivorous_plant["Carnivorous plant"]
  node_liquid_type["Liquid types<br/>[LiquidType.java]"]
end

subgraph group_shared_support["Shared support"]
  node_unit_converter["Unit converter<br/>[UnitConverter.java]"]
  node_app_constants["App constants<br/>[AppConstants.java]"]
end

node_user(("User"))
node_swing_dialogs["Swing dialogs"]

node_user -->|"enters name"| node_main
node_main -->|"prompts and displays"| node_swing_dialogs
node_main -->|"reads settings"| node_app_constants
node_main -->|"creates plant"| node_cactus
node_main -->|"creates plant"| node_palm
node_main -->|"creates plant"| node_carnivorous_plant
node_main -->|"converts height"| node_unit_converter
node_main -->|"queries match"| node_plant
node_cactus -->|"extends"| node_plant
node_palm -->|"extends"| node_plant
node_carnivorous_plant -->|"extends"| node_plant
node_plant -->|"implements"| node_waterable
node_plant -->|"returns type"| node_liquid_type
node_cactus -->|"returns type"| node_liquid_type
node_palm -->|"returns type"| node_liquid_type
node_carnivorous_plant -->|"returns type"| node_liquid_type
node_cactus -->|"converts amount"| node_unit_converter

click node_main "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Main.java"
click node_plant "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Plant.java"
click node_waterable "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Waterable.java"
click node_cactus "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Cactus.java"
click node_palm "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Palm.java"
click node_carnivorous_plant "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/CarnivorousPlant.java"
click node_liquid_type "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/LiquidType.java"
click node_unit_converter "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/UnitConverter.java"
click node_app_constants "https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/AppConstants.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_user toneBlue
class node_plant,node_waterable,node_cactus,node_palm,node_carnivorous_plant,node_liquid_type toneAmber
class node_unit_converter,node_app_constants toneMint
class node_swing_dialogs toneIndigo
```

## Components

### User interaction

- [Application flow](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Main.java): `src/TheGreenestPlantHotel/Main.java`

### Plant domain

- [Plant base](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Plant.java): `src/TheGreenestPlantHotel/Plant.java`
- [Waterable contract](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Waterable.java): `src/TheGreenestPlantHotel/Waterable.java`
- [Cactus](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Cactus.java): `src/TheGreenestPlantHotel/Cactus.java`
- [Palm](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/Palm.java): `src/TheGreenestPlantHotel/Palm.java`
- [Carnivorous plant](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/CarnivorousPlant.java): `src/TheGreenestPlantHotel/CarnivorousPlant.java`
- [Liquid types](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/LiquidType.java): `src/TheGreenestPlantHotel/LiquidType.java`

### Shared support

- [Unit converter](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/UnitConverter.java): `src/TheGreenestPlantHotel/UnitConverter.java`
- [App constants](https://github.com/niloofar-amirzadeh/thegreenestplanthotel/blob/main/src/TheGreenestPlantHotel/AppConstants.java): `src/TheGreenestPlantHotel/AppConstants.java`

### Other components

- **User**
- **Swing dialogs**

## Connections

- User → Application flow: enters name (evidence: `src/TheGreenestPlantHotel/Main.java`)
- Application flow → Swing dialogs: prompts and displays (evidence: `src/TheGreenestPlantHotel/Main.java`)
- Application flow → App constants: reads settings (evidence: `src/TheGreenestPlantHotel/Main.java`)
- Application flow → Cactus: creates plant (evidence: `src/TheGreenestPlantHotel/Main.java`)
- Application flow → Palm: creates plant (evidence: `src/TheGreenestPlantHotel/Main.java`)
- Application flow → Carnivorous plant: creates plant (evidence: `src/TheGreenestPlantHotel/Main.java`)
- Application flow → Unit converter: converts height (evidence: `src/TheGreenestPlantHotel/Main.java`)
- Application flow → Plant base: queries match (evidence: `src/TheGreenestPlantHotel/Main.java`)
- Cactus → Plant base: extends (evidence: `src/TheGreenestPlantHotel/Cactus.java`)
- Palm → Plant base: extends (evidence: `src/TheGreenestPlantHotel/Palm.java`)
- Carnivorous plant → Plant base: extends (evidence: `src/TheGreenestPlantHotel/CarnivorousPlant.java`)
- Plant base → Waterable contract: implements (evidence: `src/TheGreenestPlantHotel/Plant.java`)
- Plant base → Liquid types: returns type (evidence: `src/TheGreenestPlantHotel/Plant.java`)
- Cactus → Liquid types: returns type (evidence: `src/TheGreenestPlantHotel/Cactus.java`)
- Palm → Liquid types: returns type (evidence: `src/TheGreenestPlantHotel/Palm.java`)
- Carnivorous plant → Liquid types: returns type (evidence: `src/TheGreenestPlantHotel/CarnivorousPlant.java`)
- Cactus → Unit converter: converts amount (evidence: `src/TheGreenestPlantHotel/Cactus.java`)
