# ACA001SFBean

## Purpose

`ACA001SFBean` is a minimal JavaBean that serves as a **form-backing data object** (also known as a view-scope bean or model object) within the Futurity web framework. It exists to hold a single `String` value that can be bound to form fields in the application's UI views. Despite its simplicity, it is centrally referenced across multiple view-definition files and JSP pages, acting as the shared data carrier for the ACA001 view module.

## Design

This class follows the standard **JavaBean** convention — a private field with a public getter (`getValue()`). It does not extend any base class or implement any interfaces, relying on the container-managed lifecycle provided by the Futurity framework and JavaServer Faces (JSF).

The bean is configured in `faces-config.xml` as a **request-scoped** managed bean (`aca00Bean`), which means a new instance is created for each HTTP request and discarded afterward. It also appears as a `<SERVICEFORM>` element in Futurity XML view definitions, which signals the framework to populate the bean with form data before rendering the view.

This is a **Plain Old Java Object (POJO) data carrier** — it has no behavior beyond exposing its single `value` property. All business logic is delegated to `ACA001SFLogic`, which is referenced separately in the view definitions.

## Key Methods

### `getValue() → String`

Returns the current value of the bean's private `value` field. This is the only public method on the class.

- **Parameters**: None
- **Return value**: The current `String` held in `value`, or `null` if no value has been set.
- **Side effects**: None. This is a pure accessor (getter).

This method is the primary way consumers of the bean read its state. Since the bean is request-scoped and has no setter visible here, the framework likely injects or populates the `value` field externally (e.g., via reflection-based form binding in the Futurity framework or via EL expression binding in JSF).

## Relationships

### Who Uses This Class

| Consumer | Role |
|---|---|
| `WEBGAMEN_FULL_ACA001.xml` | Declares `<SERVICEFORM bean="...ACA001SFBean"/>` to bind form data to this bean for the FULL_ACA001 screen |
| `WEBGAMEN_ACA001010PJP.xml` | Declares `<SERVICEFORM bean="...ACA001SFBean"/>` for the ACA001010PJP view screen |
| `x33S_ACA001.xml` | References the bean via a Japanese-labeled `<フォーム>` (form) element |
| `faces-config.xml` | Registers the bean as a request-scoped JSF managed bean named `aca00Bean` |
| `FULL_ACA001010PJP.jsp` | Uses `<jsp:useBean>` to instantiate and reference the bean at request scope |

```mermaid
flowchart TD
    A["WEBGAMEN_FULL_ACA001.xml"] -->|SERVICEFORM| B["ACA001SFBean"]
    C["WEBGAMEN_ACA001010PJP.xml"] -->|SERVICEFORM| B
    D["x33S_ACA001.xml"] -->|form element| B
    E["faces-config.xml"] -->|managed bean, request scope| B
    F["FULL_ACA001010PJP.jsp"] -->|jsp:useBean, request scope| B
```

### Outbound Dependencies

None. The class has no imports, no field types beyond `String`, and does not reference any other class. It is entirely self-contained.

## Usage Example

The bean is typically used through two mechanisms:

### 1. Through the Futurity Framework (XML-driven)

In a Futurity view definition file:

```xml
<SCREEN id="FULL_ACA001">
  <BL class="eo.web.webview.ACA001SF.ACA001SFLogic"/>
  <SERVICEFORM bean="eo.web.webview.ACA001SF.ACA001SFBean"/>
</SCREEN>
```

The framework instantiates the bean, binds form data from the HTTP request into the `value` field (via reflection or setter injection), and then makes it available to the JSP view for rendering.

### 2. Through JSF Managed Bean

In `faces-config.xml`:

```xml
<managed-bean>
  <managed-bean-name>aca00Bean</managed-bean-name>
  <managed-bean-class>eo.web.webview.ACA001SF.ACA001SFBean</managed-bean-class>
  <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
```

This makes the bean available in JSF EL expressions as `#{aca00Bean}`, allowing pages to read `#{aca00Bean.value}`.

### 3. Through JSP Direct Instantiation

In `FULL_ACA001010PJP.jsp`:

```jsp
<%@ page import="eo.web.webview.ACA001SF.ACA001SFBean" %>
<jsp:useBean id="logic" class="eo.web.webview.ACA001SF.ACA001SFBean" scope="request"/>
```

The JSP uses `jsp:useBean` to obtain or create a request-scoped instance, which can then be accessed via scripting or custom tag libraries.

## Notes for Developers

- **Single field only**: The bean holds exactly one `String value`. If more state is needed, additional fields and getters/setters must be added.
- **No setter visible**: The class only declares `getValue()`. If form binding relies on a setter, it may be injected by the framework at runtime via reflection or a framework-generated subclass.
- **Request-scoped**: Every request creates a fresh instance. This means the bean is inherently thread-safe — no shared mutable state across threads.
- **Futurity framework integration**: The class is part of the "Futurity" enterprise web framework, which uses XML-based view definitions (`WEBGAMEN_*.xml`) to configure screens. The `<SERVICEFORM>` element binds form data to the bean automatically.
- **Co-located with Logic class**: `ACA001SFLogic` lives in the same package and handles business logic. The bean's role is purely data transport — the framework coordinates between the bean (data) and the logic class (behavior).
- **Zero outbound dependencies**: Because it imports nothing and references no other classes, this bean can be safely instantiated by any container without classpath concerns.
