java-design-patterns
Installation
SKILL.md
Java Design Patterns
Quick reference for all Gang of Four design patterns in Java.
Pattern Selection Guide
Creational Patterns (Object Creation)
| Pattern | Use When | Don't Use When |
|---|---|---|
| Singleton | Exactly one instance needed (DB connection, cache) | Multiple instances needed, testing is hard |
| Factory Method | Delegate instantiation to subclasses | Single product type, simple creation |
| Abstract Factory | Create families of related objects | Single products, product types change often |
| Builder | Many optional params, step-by-step construction | Few params, simple objects |
| Prototype | Creating objects is expensive, clone existing | Objects are simple, deep cloning is complex |