# Com / Github / Blaxk3 / Converter

## Overview

This module appears to be the application entry point for a currency converter UI. Its only responsibility is to launch the Swing-based user interface on the event dispatch thread, which keeps startup minimal and separates bootstrapping from the actual UI implementation.

Because the package contains just one class, this module acts as a thin adapter between the JVM process entry point and `com.github.blaxk3.ui.UI`.

## Key Classes and Interfaces

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

`CurrencyConverter` is the sole class in the package and serves as the executable entry point. It does not implement conversion logic itself; instead, it delegates startup to the UI layer.

#### Purpose

Its main role is to provide a `main(String[] args)` method so the application can be started from the command line or an IDE run configuration.

#### Key method

- [CurrencyConverter.main(String[] args)](src/main/java/com/github/blaxk3/converter/CurrencyConverter.java:8)
  - **What it does:** Schedules creation of a new `UI` instance using `SwingUtilities.invokeLater(...)`.
  - **Parameters:** `args` is accepted because it is required by the Java entry point contract, but it is not used.
  - **Returns:** `void`.
  - **Side effects:** Enqueues UI initialization on Swing’s event dispatch thread.

#### Design role

This class is intentionally small and focused. It keeps Swing startup code in one place and avoids constructing UI components directly on the main thread.

## How It Works

1. The JVM invokes `CurrencyConverter.main(String[] args)`.
2. The method calls `SwingUtilities.invokeLater(UI::new)`.
3. Swing defers execution until the event dispatch thread is ready.
4. A new `UI` instance is constructed, which appears to be where the actual application window and converter behavior are implemented.

This pattern is typical for Swing applications because UI objects should be created and manipulated on the event dispatch thread.

### Startup flow

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

## Data Model

No data model classes are defined in this package. Based on the available source, this module only bootstraps the user interface and does not define entities, DTOs, or domain objects.

## Dependencies and Integration

### Internal dependencies

- [com.github.blaxk3.ui](src/main/java/com/github/blaxk3/ui/UI.java) — the `CurrencyConverter` class depends on `UI` for application startup.

### Java platform dependencies

- `javax.swing.SwingUtilities` — used to defer UI creation onto the Swing event dispatch thread.

## Notes for Developers

- `args` is currently unused. If command-line configuration is added later, this is the natural place to parse it.
- Any new Swing UI code should continue to be created on the event dispatch thread.
- This package currently contains no business logic. If conversion rules or exchange-rate handling are introduced later, they will likely belong in other modules rather than in `CurrencyConverter` itself.
- Because the class only launches `UI`, most changes to application behavior will happen in the UI package, not here.
