design-patterns

Implement common Java design patterns with runnable code examples.

700|137|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/decebals/claude-code-java --skill design-patterns-decebals
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-patterns
Source: https://github.com/decebals/claude-code-java/tree/main/.claude/skills/design-patterns
Command: npx skills add https://github.com/decebals/claude-code-java --skill design-patterns-decebals

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Java development often reimplements common solutions; this guide provides a concise, practical reference to widely-used design patterns and how to apply them in real projects.

Core Features & Use Cases

  • Practical Java pattern references for Creational, Behavioral, and Structural patterns.
  • Concrete code samples illustrating how to apply Builder, Factory, Strategy, Observer, Decorator, Adapter, and more.
  • Use cases include designing extensible components, refactoring rigid architectures, and performing code reviews with pattern recommendations.

Quick Start

Demonstrate a practical Java design-pattern example for a selected pattern.

Frequently Asked Questions about design-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to implement common Java design patterns for real-world projects?

Java design patterns are implemented through concrete, runnable examples covering creational, behavioral, and structural categories. This guide provides practical code samples and clear explanations for applying patterns like Builder, Factory, and Strategy in real-world scenarios.

How do I use the Factory and Builder patterns in Java to handle complex object construction?

You use Factory and Builder design patterns in Java to manage complex object construction. They provide concrete code samples demonstrating step-by-step object assembly and delegated creation logic, ensuring extensible component design and reducing rigid architectural dependencies.

When should I use the Strategy pattern instead of the Observer pattern in Java?

Use the Strategy pattern in Java when swapping algorithms dynamically at runtime, and the Observer pattern when broadcasting state changes to dependent components. Both design patterns provide concrete code samples for dynamic behavior composition and extensible component integration.

Can I apply the Decorator and Adapter patterns to refactor rigid Java architectures?

Yes, you can apply Decorator and Adapter design patterns to refactor rigid Java architectures. They enable dynamic behavior composition and interface compatibility, providing practical code samples for integrating structural patterns within modern Java environments during architectural refactoring.

Does this Java design patterns guide provide guidance for code reviews?

Yes, the Java design patterns guide supports code reviews by providing pattern recommendations. It demonstrates when to use specific patterns in real-world scenarios, offering clear explanations and practical code samples to identify refactoring opportunities during architectural reviews.

How do I integrate behavioral design patterns with modern Java environments?

You integrate behavioral design patterns with modern Java environments using practical code samples demonstrating algorithm swapping and dynamic behavior composition. The guide provides clear explanations for applying patterns like Strategy and Observer correctly within modern Java architectures.