java-coding-standards
Spring Bootサービス向けのJavaコーディング標準:命名、不変性、Optional使用、ストリーム、例外、ジェネリクス、プロジェクトレイアウト。
Original · translation did not pass checksTarget: Software development & testing. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original Japanese text
Topics in the source
- Javaコーディング標準
- 核となる原則
- 命名
- 不変性
- Optionalの使用
- ストリームのベストプラクティス
- 例外
- ジェネリクスと型安全性
Spring Bootサービスにおける読みやすく保守可能なJava(17+)コードの標準。 巧妙さよりも明確さを優先 デフォルトで不変; 共有可変状態を最小化 意味のある例外で早期失敗 一貫した命名とパッケージ構造 ドメインエラーには非チェック例外を使用; 技術的例外はコンテキストとともにラップ ドメイン固有の例外を作成(例: MarketNotFoundException) 広範なcatch (Exception ex)を避ける(中央でリスロー/ログ記録する場合を除く) 生の型を避ける; ジェネリックパラメータを宣言 再利用可能なユーティリティには境界付きジェネリクスを優先 一貫して2または4スペースを使用(プロジェクト標準) ファイルごとに1つのpublicトップレベル型 メソッドを短く集中的に保つ; ヘルパーを抽出 メンバーの順序: 定数、フィールド、コンストラクタ、publicメソッド、protected、private 長いパラメータリスト → DTO/ビルダーを使用 深いネスト → 早期リターン マジックナンバー → 名前付き定数 静的可変状態 → 依存性注入を優先 サイレントなcatchブロック → ログを記録して行動、または再スロー やむを得ない場合のみ@Nullableを受け入れる; それ以外は@NonNullを使用 入力にBean Validation(@NotNull、@NotBlank)を使用 JUnit 5 + AssertJで流暢なアサーション モック用のMockito; 可能な限り部分モックを避ける 決定論的テストを優先; 隠れたsleepなし 覚えておく: コードを意図的、型付き、観察可能に保つ。必要性が証明されない限り、マイクロ最適化よりも保守性を最適化します。
- Source repository
- affaan-m/ECC
- Source file
- docs/ja-JP/skills/java-coding-standards/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:49.360Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.