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

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

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