Skip to content

fast and small Dependency Injection and annotation processor library

Notifications You must be signed in to change notification settings

nort3x/AtomicDI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Atomic-DI

CodeFactor

Atomic is lightweight, flexible, fast and fast DI framework
based around concurrent lookups and in-memory caching
it will provide a simple but rich API
take a look:

package structure:

TopPackage
|
|__ InnerPackage+
|               |__Beans
|             
|__CoffieMachine
|__Java
@Atomic 
class CoffeeMachine{
    
    @Atom Beans;
    @Atom Java;
    
  }


@Atomic 
class Java{
    
    @Atom Beans;
    @Atom CoffeMachine;

    @Exclude
    BadBeans;
    @Atom(scope = Scope.Shared, concreteType = MyImpl.class)
    Database db;

    @Predifiend(key = "Author")
    String author;
    @Predifiend(key="Mode") MyEnumType mode;
    
    @Interaction void beingJava(@Atom Beans newBeans)
  }
  
  
@Atomic 
class Beans{
    
    @Atom CoffeMachine;
    @Atom Java;
    
  }


/* somewhere in your routines */

    AtomicDI.getInstance().resolve(MainClassOfTopPackage.class);
    Java j = (Java) Container.makeContainerAround(AtomicType.of(Java.class)).getCentral();
    
    // do what ever you want with java!
    

Features

  • Small and Flexible DI framework
  • Fully Extendable and injectable
  • Concurrent and Modular
  • Cyclic Dependency Resolution
  • CompileTime Processor for minimizing Exceptions
  • Flexible Logger
  • Vanilla Java, lightweight
  • AutoRunners and Module Handlers [not yet]
  • LiveReloadable Modules [not yet]

Examples

  • AtomicJDA - AtomicDI approach for developing Discord Bot(s)

Installation

gradle

Add it in your root build.gradle at the end of repositories: (if not already!)

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.nort3x:AtomicDI:2.0.5'
}

maven

Step 1. Add the JitPack repository to your build file (if not already!)

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Step 2. Add the dependency

<dependency>
    <groupId>com.github.nort3x</groupId>
    <artifactId>AtomicDI</artifactId>
    <version>2.0.5</version>
</dependency>