Micro DI Project Root

Micro Dependency Injection Library

License

License

GroupId

GroupId

com.truward
ArtifactId

ArtifactId

micro-di-root
Last Version

Last Version

1.0.10
Release Date

Release Date

Type

Type

pom
Description

Description

Micro DI Project Root
Micro Dependency Injection Library
Project URL

Project URL

https://github.com/avshabanov/micro-di
Source Code Management

Source Code Management

https://github.com/avshabanov/micro-di

Download micro-di-root

Filename Size
micro-di-root-1.0.10.pom 5 KB
Browse

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • micro-di

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