Needle
An ultra-lightweight dependency injection framework for Java, without the bloat.
What is Needle?
Needle is our response to bloated dependency injection frameworks. It gives you exactly what you need for clean, modular Java applications, without the overhead.
Think of it as Spring, but lightweight and with a minimal learning curve - just simple annotations and automatic dependency resolution.
Simple to Use
public class Main {
public static void main(String[] args) {
Needle init = Needle.init(Main.class);
}
}
@Component
public class ExampleService {
private String name;
}
@Component
public class SampleConfig {
@Component
SampleComponent create() {
return new SampleComponent();
}
}
@Getter
public class SampleService {
private final SampleComponent sampleComponent;
public SampleService(SampleComponent sampleComponent) {
this.sampleComponent = sampleComponent;
}
}
Key Features
LWLightweight
Minimal overhead, designed to be fast and efficient with no bloat.
ANAnnotation-based
Simple annotations to define components and dependencies.
ADAuto-resolution
Automatically resolves and injects dependencies where needed.
INIntegration
Seamlessly integrates with other frameworks and libraries.
Get Started
Add Needle to your Maven project:
<dependency>
<groupId>dev.pixelib</groupId>
<artifactId>needle</artifactId>
<version>1.0.0</version>
</dependency>
Why We Built It
We built Needle because we wanted Spring-like dependency injection without the massive overhead and complexity. Java developers shouldn't need a heavyweight framework just for clean architecture.
Needle strips away everything unnecessary, leaving just what you need to create modular, testable, and maintainable Java applications.