# Com / Github / Blaxk3 / Converter

## Overview

`com.github.blaxk3.converter` is a very small bootstrap package whose only visible responsibility is to start the currency converter application. It does not contain business logic, conversion rules, or UI behavior itself; instead, it hands control to the Swing UI layer and ensures the application is created on the Event Dispatch Thread.

This module appears to exist as the executable entry point for the application, keeping startup concerns separate from the UI implementation in `com.github.blaxk3.ui`.

## Key Classes and Interfaces

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

`CurrencyConverter` is the package's entry-point class. Its role is minimal but important: it provides the `main` method used to launch the application and delegates actual UI creation to [`UI`](src/main/java/com/github/blaxk3/ui/UI.java) through `SwingUtilities`.

#### Key method

- [`main(String[] args)`](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:8)
  - **Purpose:** Starts the application.
  - **Parameters:** `args`, the standard Java command-line arguments array. The current implementation does not inspect or use these arguments.
  - **Returns:** `void`.
  - **Behavior:** Calls `SwingUtilities.invokeLater(UI::new)`, which schedules construction of a new `UI` instance on the Swing event thread.
  - **Side effects:** Triggers application startup by creating the UI asynchronously.

## How It Works

The startup flow is straightforward:

1. The JVM calls `CurrencyConverter.main(...)` when the application is launched.
2. `main` submits a UI-creation task to `SwingUtilities.invokeLater(...)`.
3. Swing executes the task on the Event Dispatch Thread.
4. The `UI` constructor is invoked, which appears to initialize the application's window and interaction layer.

This design keeps Swing initialization on the correct thread, which is important for UI safety and responsiveness.

### Relationship flow

```mermaid
flowchart TD
    MainClass["CurrencyConverter"]
    Swing["SwingUtilities.invokeLater"]
    UIClass["UI"]
    MainClass --> Swing
    Swing --> UIClass
```

## Data Model

There are no explicit entity, DTO, or model classes in this package. The module is purely a launcher and does not define domain data structures.

## Dependencies and Integration

### Direct dependency

- [`com.github.blaxk3.ui`](src/main/java/com/github/blaxk3/ui/UI.java)
  - `CurrencyConverter` imports [`UI`](src/main/java/com/github/blaxk3/ui/UI.java) and constructs it indirectly via method reference.

### Platform dependency

- `javax.swing.SwingUtilities`
  - Used to enqueue UI creation on the Swing event thread.

## Notes for Developers

- `main(String[] args)` currently ignores its arguments. If you need command-line configuration, this is the natural place to parse and pass it into the UI layer.
- Because UI construction happens through `SwingUtilities.invokeLater(...)`, any future startup code that must complete before the UI appears should be added before the `invokeLater` call.
- This package intentionally stays thin. Keep application logic out of `CurrencyConverter` and place it in UI or domain packages so the entry point remains simple.
