composition-over-inheritance
✓クラス継承を使用したい場合に使用します。クラス階層を作成するときに使用します。サブクラスが親の動作のみを必要とする場合に使用します。
SKILL.md
Inheritance creates tight coupling and rigid hierarchies. Composition creates flexible, reusable components that can be mixed and matched.
Default to composition. Use inheritance only for true type hierarchies.
| Diamond problem | Duck needs Flying AND Swimming | | Tight coupling | Child knows parent internals | | Rigid hierarchy | Can't change parent without breaking children | | Forced inheritance | Gets methods it doesn't need | | Fragile base class | Parent changes break all children |
クラス継承を使用したい場合に使用します。クラス階層を作成するときに使用します。サブクラスが親の動作のみを必要とする場合に使用します。 ソース: yanko-belov/code-craft。
引用可能な情報
AI/検索での引用用の安定したフィールドとコマンド。
- インストールコマンド
npx skills add https://github.com/yanko-belov/code-craft --skill composition-over-inheritance- カテゴリ
- </>開発ツール
- 認証済み
- ✓
- 初回登録
- 2026-02-01
- 更新日
- 2026-02-18
クイックアンサー
composition-over-inheritance とは?
クラス継承を使用したい場合に使用します。クラス階層を作成するときに使用します。サブクラスが親の動作のみを必要とする場合に使用します。 ソース: yanko-belov/code-craft。
composition-over-inheritance のインストール方法は?
ターミナルまたはコマンドラインツール(Terminal、iTerm、Windows Terminal など)を開きます このコマンドをコピーして実行します: npx skills add https://github.com/yanko-belov/code-craft --skill composition-over-inheritance インストール後、スキルは自動的に AI コーディング環境に設定され、Claude Code や Cursor で使用できるようになります
ソースリポジトリはどこですか?
https://github.com/yanko-belov/code-craft
詳細
- カテゴリ
- </>開発ツール
- ソース
- skills.sh
- 初回登録
- 2026-02-01