Skip to content
/ Needle Public

A ultra lightweight dependency injection framework like Spring

Notifications You must be signed in to change notification settings

pixelib/Needle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b8b5c87 Β· Feb 10, 2025

History

17 Commits
Feb 10, 2025
Feb 7, 2025
Jul 22, 2024
Feb 10, 2025
Feb 7, 2025

Repository files navigation

logo

🌱 Needle Test Coverage Hyves

Needle is an ultra-lightweight dependency injection framework for Java, similar to Spring. It simplifies the management of dependencies in your application, making your code more modular, testable, and maintainable.

✨ Features

  • Lightweight: Minimal overhead, designed to be fast and efficient.
  • Annotation-based: Use simple annotations to define dependencies.
  • Automatic Dependency Resolution: Automatically resolves and injects dependencies.
  • Integration: Easily integrates with other frameworks and libraries.

πŸš€ Usage

πŸ“˜ Main class Example

public class Main {
    public static void main(String[] args) {
        Needle init = Needle.init(Main.class);
    }
}

πŸ“™ Class components Example

@Component
public class ExampleService {
    
    private String name;
}

πŸ“— Method components Example

@Component
public class SampleConfig {

    @Component
    SampleComponent create() {
        return new SampleComponent();
    }
}

πŸ“• Defining Dependencies

@Getter
public class B {
    @Wired
    private C depC;
}
@Getter
public class SampleService {
    
    private final SampleComponent sampleComponent;
    
    public SampleService(SampleComponent sampleComponent) {
        this.sampleComponent = sampleComponent;
    }
}

πŸ“¦ Installation

Add the following dependency to your Maven project:

<dependency>
    <groupId>dev.pixelib</groupId>
    <artifactId>needle</artifactId>
    <version>1.0.0</version>
</dependency>

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A ultra lightweight dependency injection framework like Spring

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages