Micro DI library

Micro Dependency Injection Library

License

License

GroupId

GroupId

com.truward
ArtifactId

ArtifactId

micro-di
Last Version

Last Version

1.0.10
Release Date

Release Date

Type

Type

jar
Description

Description

Micro DI library
Micro Dependency Injection Library

Download micro-di

How to add to project

<!-- https://jarcasting.com/artifacts/com.truward/micro-di/ -->
<dependency>
    <groupId>com.truward</groupId>
    <artifactId>micro-di</artifactId>
    <version>1.0.10</version>
</dependency>
// https://jarcasting.com/artifacts/com.truward/micro-di/
implementation 'com.truward:micro-di:1.0.10'
// https://jarcasting.com/artifacts/com.truward/micro-di/
implementation ("com.truward:micro-di:1.0.10")
'com.truward:micro-di:jar:1.0.10'
<dependency org="com.truward" name="micro-di" rev="1.0.10">
  <artifact name="micro-di" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.truward', module='micro-di', version='1.0.10')
)
libraryDependencies += "com.truward" % "micro-di" % "1.0.10"
[com.truward/micro-di "1.0.10"]

Dependencies

compile (1)

Group / Artifact Type Version
com.google.code.findbugs : jsr305 jar 1.3.9

test (2)

Group / Artifact Type Version
junit : junit jar 4.8.2
org.easymock : easymock jar 3.0

Project Modules

There are no modules declared in this project.

micro-di

Micro Dependency Injection Framework for Java (~10Kb)

Sample Usage

public interface Foo {
  int foo();
}

public interface Bar {
  int bar();
}

public class FooImpl implements Foo {
  @Override public int foo() { return 1; }
}

public class BarImpl implements Bar {
  @Resource private Foo foo;

  @Override public int bar() { return 10 + foo.foo(); }
}

// usage:
InjectionContext context = new DefaultInjectionContext();
context.registerBean(new FooImpl());
context.registerBean(new BarImpl());
context.freeze(); // "locks" context, so that it becames read-only

final Foo foo = context.getBean(Foo.class);
// actions on foo

Compiling from sources and installing to the local maven repository

Just do mvn clean install in source folder

Adding to maven project with minimal fuss

Add jar dependency in your pom.xml:

<dependency>
  <groupId>com.truward.di</groupId>
  <artifactId>micro-di</artifactId>
  <version>1.0.5</version>
</dependency>

Have fun!

Versions

Version
1.0.10