kotlin-patterns
コルーチン、null 安全性、DSL ビルダーを使用して堅牢・効率的・保守性の高い Kotlin アプリケーションを構築するための慣用的な Kotlin パターン、ベストプラクティス、規約。
Original · translation did not pass checksTarget: Target not categorized. 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
- Kotlin 開発パターン
- 使用するタイミング
- 動作の仕組み
- 使用例
- コア原則
- 1. Null 安全性
- 2. デフォルトでイミュータブル
- 3. 式ボディと単一式関数
堅牢・効率的・保守性の高いアプリケーションを構築するための慣用的な Kotlin パターンとベストプラクティス。 新しい Kotlin コードを書く Kotlin コードをレビューする 既存の Kotlin コードをリファクタリングする Kotlin モジュールまたはライブラリを設計する Gradle Kotlin DSL ビルドを設定する このスキルは 7 つの主要領域にわたって慣用的な Kotlin の規約を適用します: 型システムとセーフコール演算子を使用した null 安全性、val とデータクラスの copy() によるイミュータビリティ、網羅的な型階層のためのシールドクラスとインターフェース、コルーチンと Flow による構造化並行性、継承なしで振る舞いを追加する拡張関数、@DslMarker とラムダレシーバーを使用した型安全 DSL ビルダー、そしてビルド設定のための Gradle Kotlin DSL。 Elvis 演算子を使用した null 安全性: 網羅的な結果のためのシールドクラス: async/await を使用した構造化並行性: Kotlin の型システムは null 可能型と非 null 型を区別します。これを最大限に活用してください。 var より val を優先し、ミュータブルコレクションよりイミュータブルコレクションを優先してください。 簡潔で読みやすい関数には式ボディを使用してください。 主にデータを保持する型にはデータクラスを使用してください。 | イディオム | 説明 | |-----------|------| | val over var | イミュータブル変数を優先 | | data class | equals/hashCode/copy を持つ値オブジェクト用 | | sealed class/interface | 制限された型階層用 | | value class | ゼロオーバーヘッドの型安全ラッパー | | 式 when | 網羅的なパターンマッチング | | セーフコール ?. | null 安全なメンバーアクセス | | Elvis ?: | null 可能型のデフォルト値 | | let/apply/also/run/with | クリーンなコードのためのスコープ関数 | | 拡張関数 | 継承なしで振る舞いを追加 | | copy() | データクラスのイミュータブルな更新 | | require/check | 事前条件アサーション | | コルーチン async/await | 構造化された並行実行 | | Flow | コールドリアクティブストリーム | | sequence | 遅延評価 | | 委譲 by | 継承なしで実装を再利用 | 覚えておくこと: Kotlin のコードは簡
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- docs/ja-JP/skills/kotlin-patterns/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.383Z.
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.