java-design-principles

aucun6352's avatarfrom aucun6352

A comprehensive guide providing essential design principles and best practices for Java development

⭐1stars🔀1forks📁View on GitHub🕐Updated Nov 25, 2025

When & Why to Use This Skill

This Claude skill serves as a comprehensive knowledge base for Java design principles and best practices. It provides a structured learning path from foundational concepts like KISS and DRY to advanced object-oriented patterns such as SOLID, helping developers build maintainable, scalable, and high-quality software architectures.

Use Cases

  • Architectural Decision Making: Use the guide to apply SOLID and simplicity principles when designing new Java systems to ensure long-term maintainability and extensibility.
  • Refactoring and Technical Debt Management: Reference the best practices and common pitfalls to identify design violations in existing code and implement improvements that increase cohesion.
  • Systematic Code Reviews: Utilize the provided checklists to evaluate code quality during peer reviews, ensuring adherence to industry-standard design patterns.
  • Developer Mentorship and Training: Leverage the structured learning path to onboard junior developers and establish a shared understanding of core engineering principles within a team.
  • Dependency and Module Management: Apply principles like 'Composition Over Inheritance' and the 'Law of Demeter' to minimize coupling between software modules and simplify complex systems.
namejava-design-principles
descriptionA comprehensive guide providing essential design principles and best practices for Java development
licenseMIT

Java Design Principles

A comprehensive guide providing essential design principles and best practices for Java development. Structured for step-by-step learning from beginners to advanced developers.

When to Use This Skill

Use this skill in the following situations:

  • 🏗️ When designing new Java projects - Apply correct principles when making architectural decisions
  • 🔧 When refactoring existing code - Check guidelines for code quality improvement
  • 👀 When performing code reviews - Systematically review for design principle violations
  • 🎯 When making class design decisions - Inheritance vs composition, interface segregation, etc.
  • 🧩 When managing dependencies between modules - Methods to reduce coupling and increase cohesion
  • 📚 When training junior developers - Systematically convey core design principles
  • 🐛 When resolving technical debt - Identify which principles have been violated and improve

📚 Learning Path

🌱 Beginner - Starting with Simplicity

An introductory course for those learning design principles for the first time.

  1. Simplicity Principles

    • KISS (Keep It Simple, Stupid)
    • YAGNI (You Aren't Gonna Need It)
    • Do The Simplest Thing That Could Possibly Work

    💡 Why learn this first? Before learning complex principles, developing the habit of writing simple code is most important.

🚀 Intermediate - Core Design Principles

Learn the core principles of object-oriented design.

  1. SOLID Principles

    • Single Responsibility Principle
    • Open/Closed Principle
    • Liskov Substitution Principle
    • Interface Segregation Principle
    • Dependency Inversion Principle

    💡 Why is this important? SOLID is an essential principle for writing maintainable and extensible code.

  2. Coupling and Cohesion

    • DRY (Don't Repeat Yourself)
    • Separation of Concerns
    • Minimize Coupling / Maximize Cohesion
    • Law of Demeter
    • Composition Over Inheritance

    💡 Practical Application: Learn how to properly design relationships between modules.

🎯 Advanced - In-depth Principles and Patterns

Learn more in-depth design principles and practical patterns.

  1. Encapsulation

    • Encapsulation & Information Hiding
    • Encapsulate What Changes
  2. Advanced Principles

    • Code For The Maintainer
    • Boy-Scout Rule
    • Avoid Premature Optimization
    • Inversion of Control
    • Command Query Separation
    • Robustness Principle (Postel's Law)
  3. Practical Patterns

    • Good vs Bad examples of 5 core patterns
    • Single Responsibility
    • Open/Closed
    • Law of Demeter
    • Composition Over Inheritance
    • DRY

📖 Additional Resources

🎓 Learning Tips

  1. Week 1: Read and practice simplicity principles
  2. Week 2-3: Learn SOLID principles one by one (one per day)
  3. Week 4: Understand coupling/cohesion concepts
  4. Week 5: Practice with practical patterns
  5. Week 6+: Code review with Best Practices checklist

For Those with Experience

  • Learn selectively starting with principles of interest
  • Read Common Pitfalls first and apply to your current code
  • Use this guide as reference documentation during team code reviews

📂 Project Structure

java-design-principles/
├── SKILL.md (this file)
├── core-concepts/
│   ├── simplicity-principles.md
│   ├── solid-principles.md
│   ├── coupling-cohesion.md
│   ├── encapsulation.md
│   └── advanced-principles.md
├── patterns/
│   └── common-patterns.md
├── best-practices.md
└── resources.md

🤝 Contributing

If you want to contribute to this guide:

  • Open an issue if you find typos or improvements
  • Send a Pull Request if you have better examples
  • Share practical use cases

License: MIT Last Updated: November 2025

Happy Coding! 🚀