# Com / Github / Blaxk3 / Converter

## Overview

This module appears to be the application entry point for a Swing-based currency converter UI. It contains a single bootstrap class, [`CurrencyConverter`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:7), whose job is to start the graphical user interface on the Swing event dispatch thread.

In practice, this package is intentionally small: it does not contain business logic or conversion rules itself. Instead, it wires the application startup to the UI layer in [`com.github.blaxk3.ui`](src/main/java/com/github/blaxk3/ui/UI.java), so the rest of the system can focus on interface behavior and conversion features elsewhere.

## Key Classes and Interfaces

### [`CurrencyConverter`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:7)

`CurrencyConverter` is the only class in this package and functions as the launch point for the application. Its design role is minimal but important: it isolates startup logic from the UI implementation and ensures the UI is created in the correct Swing threading context.

#### Method: [`CurrencyConverter.main(String[] args)`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:8)

- **Purpose:** Starts the application by scheduling construction of the UI.
- **Parameters:** `String[] args` is accepted in the standard Java entry-point shape, but the method does not inspect or use the arguments.
- **Returns:** `void`.
- **Behavior:** Calls `SwingUtilities.invokeLater(UI::new)`, which defers UI creation until Swing can run it on the event dispatch thread.
- **Side effects:** Instantiates the UI, which likely opens the application window and initializes the user interface.

This method is the entire execution path for the module, so any application startup changes would happen here or in the UI class it invokes.

## How It Works

The startup flow is very short:

1. The JVM invokes [`CurrencyConverter.main(String[] args)`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:8).
2. The method calls `SwingUtilities.invokeLater(...)`.
3. Swing schedules the supplied constructor reference, `UI::new`, to run on the event dispatch thread.
4. The UI object is created by [`com.github.blaxk3.ui.UI`](src/main/java/com/github/blaxk3/ui/UI.java), which is responsible for the visible application behavior.

This pattern is standard for Swing applications because it avoids building or mutating UI components off the event dispatch thread.

### Mermaid: startup relationship

```mermaid
flowchart LR
A["CurrencyConverter"] --> B["UI"]
A --> C["SwingUtilities.invokeLater"]
```

## Dependencies and Integration

This module has one direct dependency pattern visible in the source:

- [`com.github.blaxk3.ui.UI`](src/main/java/com/github/blaxk3/ui/UI.java) — the UI class instantiated during startup.
- `javax.swing.SwingUtilities` — used to schedule the UI creation on the Swing event dispatch thread.

There are no other indexed classes, interfaces, or cross-module relationships in this package. That means this module serves as a thin integration layer between the Java launcher and the UI module.

## Notes for Developers

- [`CurrencyConverter`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:7) does not currently parse command-line arguments. If startup configuration is needed later, this is the natural place to add argument handling before the UI is launched.
- Because the UI is created via `SwingUtilities.invokeLater(...)`, any additional startup work that touches Swing components should also happen on the event dispatch thread.
- The package name suggests a converter application, but this module itself does not implement conversion logic. Any future business rules, currency data handling, or validation would likely live in the UI layer or a separate service/model package.
- Keep this module small and focused on bootstrapping. That makes it easier to reason about application launch and reduces the chance of threading mistakes during UI initialization.
