# Getting Started

> **You just joined the team — where do I start reading?**

This guide walks new engineers through the codebase from day one. Read it top-to-bottom to understand what the project does, where to find things, and the right order to explore the code.

## What This Project Does

This repository contains a collection of Java edge-case classes used as a testbed and reference implementation for data modeling and business logic patterns found in enterprise systems. It exercises diverse scenarios — from order processing to large multi-field business entities — with particular focus on internationalization support for Japanese-language data, including EUC-JP character encoding and mixed Japanese/English labeling conventions. There are no external framework dependencies; this is plain Java designed to be simple to compile and run.

## Recommended Reading Order

Follow this path to build context efficiently. Each step introduces only one new concept at a time.

```mermaid
flowchart LR
    STEP1["1. OrderProcessor<br/>Javadoc entry point"]
    STEP2["2. ProductService<br/>Simple service"]
    STEP3["3. LargeBusinessLabelClass<br/>50-field model"]
    STEP4["4. MixedLabelClass<br/>PartialLabelEntity<br/>Label patterns"]
    STEP5["5. EucJpClass<br/>LargeFieldMap<br/>Internationalization"]
    STEP6["6. MultiPattern<br/>A.java<br/>Edge cases"]
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> STEP5
    STEP5 --> STEP6
```

1. **p2-edge-cases/OrderProcessor.java** — The only class with Javadoc documentation and a `createOrder` method. This is the clearest entry point into the business logic and sets expectations for the rest of the code.

2. **p2-edge-cases/ProductService.java** — A minimal companion service class with a `productId` field and `getProduct` method. Demonstrates the simple service pattern used throughout.

3. **p2-edge-cases/LargeBusinessLabelClass.java** — A 50-field data model where every field carries a Japanese-language comment label. This is the most substantial entity and illustrates the scale of business data handled by the system.

4. **p2-edge-cases/MixedLabelClass.java** and **p2-edge-cases/PartialLabelEntity.java** — Read these together to understand the inconsistency patterns in field labeling: mixed languages, missing comments, and alternating labeled/unlabeled fields.

5. **p2-edge-cases/EucJpClass.java** and **p2-edge-cases/LargeFieldMap.java** — Review these to understand the internationalization and service interface mapping concerns. `LargeFieldMap` maps incoming service payloads with fields like contract numbers, processing divisions, and membership IDs.

6. **p2-edge-cases/MultiPattern.java** and **p2-edge-cases/A.java** — Smaller classes that complete the picture. `MultiPattern` contains version-controlled comment markers (`ANK-4494-00-00`), and `A` is a placeholder stub.

## Key Entry Points

These are the classes most worth understanding first:

- **OrderProcessor** — Entry point for business logic. Its Javadoc comments set the documentation standard for the rest of the codebase.
- **ProductService** — Entry point for understanding the service layer pattern. Simple enough to read in under a minute.
- **LargeBusinessLabelClass** — The largest data model in the project (50 fields). Understanding this class gives you the vocabulary for reading the rest.

## Project Structure

The repository is intentionally minimal — a single module with no package nesting.

```
p2-edge-cases/
  src/main/java/
    A.java                     -- Placeholder class (empty)
    EucJpClass.java            -- EUC-JP encoding data model
    LargeBusinessLabelClass.java -- 50-field business entity
    LargeFieldMap.java         -- Service interface field map
    MixedLabelClass.java       -- Mixed Japanese/English labels
    MultiPattern.java          -- Version-controlled pattern fields
    OrderProcessor.java        -- Order creation logic (entry point)
    PartialLabelEntity.java    -- Partially labeled entity
    ProductService.java        -- Product retrieval service
```

There is no build tool configuration (Maven, Gradle, etc.) and no external dependencies. Compile with `javac` directly from the `src/main/java` directory.

All classes are independent — there are no inter-class dependencies, package declarations, or imports between them. Each class is a self-contained unit.

## Configuration

There are no configuration files in this repository. No `pom.xml`, `build.gradle`, `application.yml`, or `properties` files were detected. The project is designed to be compiled and run with a standard JDK out of the box.

## Common Patterns

### No Framework Dependencies
All classes are plain Java. There are no Spring, Hibernate, or other framework annotations. Methods are simple public methods that return values directly.

```java
public class ProductService {
    private String productId = "";
    public String getProduct() { return productId; }
}
```

### Japanese-Language Comments
Many fields carry inline comments in Japanese, reflecting the project's focus on Japanese-language enterprise systems:

```java
private String userId = ""; // ユーザーID
private String orgCode = ""; // 組織コード
```

### Consistent Field Naming
Field names use a mix of camelCase, uppercase abbreviations, and Japanese transliteration (e.g., `keiNo` for 契約番号, `syoriDiv` for 処理区分). There is no enforced naming standard — the variety reflects how these models evolved from legacy systems.

### Version-Controlled Comment Markers
Some classes include explicit version markers around code additions, such as `ANK-4494-00-00 ADD START` / `END` in `MultiPattern.java`. These track incremental changes and may be useful for auditing.

```java
// ANK-4494-00-00 ADD START
private String keiNo = "";  // 契約番号
// ANK-4494-00-00 ADD END
```

### Edge-Case Coverage
The repository is organized as a collection of scenarios rather than a monolithic application. Each class represents a distinct edge case:

- **LargeBusinessLabelClass** — Data models with an unusually high number of fields (50)
- **EucJpClass** — Legacy EUC-JP character encoding requirements
- **MixedLabelClass** — Inconsistent labeling (Japanese, English, and missing comments)
- **PartialLabelEntity** — Alternating labeled and unlabeled fields

Understanding these edge cases is the primary purpose of this codebase — they serve as test inputs or reference patterns for systems that need to handle diverse data structures.
