# (DD03) Business Logic — Sortingss.vis() [8 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `algo_Calc.Sortingss` |
| Layer | Utility |
| Module | `algo_Calc` (Package: `algo_Calc`) |

## 1. Role

### Sortingss.vis()

`vis()` is a small UI bootstrap method that prepares the `Sortingss` window for display and binds the caller-provided title text into the form state. Business-wise, it acts as a presentation-entry helper rather than a calculation routine: it copies the supplied key into the screen state, overwrites the internal title field through a short sequence of assignments, and then makes the Swing frame visible to the user. The method does not branch, persist data, or invoke any domain service; instead, it performs local state initialization and immediate UI activation.

The method also behaves like a simple dispatcher for screen presentation, because the final screen title comes from the last assignment in the sequence. The hardcoded interim values (`"Hello"` and `"pop"`) are transient and are replaced before the frame is shown, so the effective business outcome is that the caller-provided `str` becomes the visible title context. In the larger system, this method functions as a reusable window-opening utility inside the `algo_Calc` package.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["vis(k, str)"])
    SET_KEY["Set instance field key = k"]
    SET_TNAME1["Set instance field tname = \"Hello\""]
    SET_TNAME2["Set instance field tname = \"pop\""]
    SET_TNAME3["Set instance field tname = str"]
    SHOW_FRAME["Call frame.setVisible(true)"]
    RETURN_ZERO["Return 0"]

    START --> SET_KEY
    SET_KEY --> SET_TNAME1
    SET_TNAME1 --> SET_TNAME2
    SET_TNAME2 --> SET_TNAME3
    SET_TNAME3 --> SHOW_FRAME
    SHOW_FRAME --> RETURN_ZERO
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `k` | `int` | Screen-state key or control value used to initialize the internal `key` field before the window is displayed. It can be any integer supplied by the caller and affects only the in-memory state of this `Sortingss` instance. |
| 2 | `str` | `String` | Title text or display label supplied by the caller. It is copied into the `tname` field and becomes the final string state that the screen carries when the frame is shown. |

**Instance fields / external state read by this method:** `key`, `tname`, `frame`.

## 4. CRUD Operations / Called Services

This method does not invoke any CRUD-oriented service, repository, DAO, or external business component. It only performs local field assignments and a Swing UI visibility call.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `frame.setVisible(true)` | - | Swing `JFrame` | Makes the window visible on screen; this is a presentation action, not a database operation. |

## 5. Dependency Trace

### Pre-computed evidence from code analysis graph:

No screen/batch entry points found within 8 hops. Direct callers found: 0 methods.
Terminal operations from this method: -

`vis()` is a leaf-style UI method in the current code sample. No Java callers were found by the caller search, and the method itself does not cascade into downstream business services. Its only terminal effect is opening the `JFrame` through Swing.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | None found | `Sortingss.vis` | `frame.setVisible(true) [presentation]` |

## 6. Per-Branch Detail Blocks

**Block 1** — [SEQUENTIAL] `(no branch)` (L190-L197)

> Initializes screen state, copies caller inputs into instance fields, and opens the UI.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = k;` // Store the caller-supplied control key into instance state |
| 2 | SET | `tname = "Hello";` // Temporary title seed |
| 3 | SET | `tname = "pop";` // Temporary override of the title seed |
| 4 | SET | `tname = str;` // Final title value from caller input |
| 5 | EXEC | `frame.setVisible(true);` // Display the Swing window |
| 6 | RETURN | `return 0;` // Return success/status code |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `vis` | Method | Visibility/display launcher for the `Sortingss` screen. |
| `key` | Field | Internal screen control key copied from the caller. |
| `tname` | Field | Title name or display text associated with the screen. |
| `k` | Parameter | Input control key used to seed the instance state. |
| `str` | Parameter | Input title text passed in by the caller. |
| `frame` | Field | Swing window object that is shown to the user. |
| `JFrame` | Technical term | Java Swing top-level window container. |
| `setVisible(true)` | Technical operation | Marks the UI window as visible and ready for interaction. |
| `algo_Calc` | Module | Package containing calculation/UI helper classes. |
| `Sortingss` | Class | Screen helper class that manages the window lifecycle. |