spring-boot-dependency-injection

Community

Master Spring Boot's DI patterns.

AuthorMassimilianoPili
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps developers correctly implement and understand dependency injection (DI) in Spring Boot applications, ensuring maintainable, testable, and robust code.

Core Features & Use Cases

  • Constructor Injection: Guides users to prioritize constructor injection for mandatory dependencies, promoting immutability and testability.
  • Optional Dependencies: Demonstrates how to handle optional collaborators using setter injection or ObjectProvider.
  • Bean Configuration & Resolution: Explains techniques like @Qualifier, @Primary, and conditional beans to manage complex wiring scenarios.
  • Use Case: A developer is refactoring a legacy Spring service that uses field injection. This Skill provides clear patterns to migrate to constructor injection, making the service easier to unit test and understand.

Quick Start

Apply constructor injection to the UserService class by adding a constructor that accepts UserRepository and EmailService as parameters.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: spring-boot-dependency-injection
Download link: https://github.com/MassimilianoPili/claude-code-config/archive/main.zip#spring-boot-dependency-injection

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.