greetgo.depinject.gen

Depinject code generation logic

License

License

GroupId

GroupId

kz.greetgo.depinject
ArtifactId

ArtifactId

greetgo.depinject.gen
Last Version

Last Version

2.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

greetgo.depinject.gen
Depinject code generation logic
Project URL

Project URL

https://github.com/greetgo/greetgo.depinject
Source Code Management

Source Code Management

https://github.com/greetgo/greetgo.depinject.git

Download greetgo.depinject.gen

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
kz.greetgo.depinject : greetgo.depinject jar 2.2.2
kz.greetgo : greetgo.java_compiler jar 2.0.4
kz.greetgo.util : greetgo.util jar 0.1.3
kz.greetgo.class_scanner : greetgo.class_scanner jar 2.0.4

test (2)

Group / Artifact Type Version
org.testng : testng jar 6.14.3
org.easytesting : fest-assert-core jar 2.0M10

Project Modules

There are no modules declared in this project.

greetgo.depinject

Здесь на русском

Implementation of Dependency Injection pattern based on code generation by greetgo!.

References

Features

  • NO dependencies;
  • Minimum size;

    What goes into production, contains only one class with one small static method, the rest is interfaces and annotations

  • The definition of the beans topology (the speed of this operation is O (n*n), where n - the number of beans), occurs at the compilation stage, not at runtime;

    This allows to make the system runtime always fast, and independent of the number of beans in the system

  • Initialization of beans occurs in the order of use, not in the order of dependencies, therefore, if the beans are not used, they are not created

    For example, BEAN_1 contains a reference to BEAN_2. Now, when initializing BEAN_1, BEAN_2 will not be initiated. BEAN_2 will be initiated only when it is accessed directly. This makes the speed of the system runtime independent of the number of beans.

  • Reflection is not used in bean-containers, hence everything is properly optimized!

Disadvantages

  • an access to the bean can only be done through the method get(). Unfortunately, it does not work out directly (as in Spring @Autowired), because the bean must be initialized at the first access, not when the dependency is formed.

    Access can be done in this way:

  class SomeBean {
    public BeanGetter<SomeAnotherBean> someAnotherBean;
    public void someMethod() {
        someAnotherBean.get().helloWorld();
    }
  }
  • Fields BeanGetter must be public! (Because the reflection is not used in production);
  • Complicated build (it is necessary to generate the bean-container code, compile and add it to the distribution);
  • Currently, only TestNG is supported. (It's great if someone implements greetgo.depinject.junit) ;

Versions

Version
2.2.2
2.2.1
2.2.0
2.1.8
2.1.7
2.1.6
2.1.5
2.1.3
2.1.1
2.1.0
2.0.3
2.0.1
2.0.0
1.1.4