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!
- 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]
- AtomicJDA - AtomicDI approach for developing Discord Bot(s)
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'
}
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>