0
I Use This!
Activity Not Available
Analyzed almost 3 years ago. based on code collected almost 3 years ago.

Project Summary

Status: proof of concept, seeking Feedback

"Here's one I made earlier."

Hoime aims to simplify the use of existing dependency injection frameworks by eliminating explicit injection code. This is achieved by weaving injection requests into object constructors as required.

The goal is to move from this:

Injector injector = ...
Greeter g = new Greeter("Richard");
injector.injectMembers(g);
assertEquals("Hello Richard", g.getText());to this:

Greeter g = new Greeter("Richard");
assertEquals("Hello Richard", g.getText());Basic usage is as follows.

Determine which classes to include/exclude from transparent injection, before any injectable classes have been loaded:

InjectionContext.setIncludedClasses("hoime.guice.**");Configure the dependency injection framework you are using, Guice in this case.

Module module = new AbstractModule() {
protected void configure() {
bind(String.class).toInstance("Moshimoshi");
}
};
Injector injector = Guice.createInjector(module);Attach it to hoime:

InjectionContext.setInjector(new GuiceInjector(injector));Start using your transparently injected objects:

String greeting = new Greeter("Richard").getText();
assertEquals("Moshimoshi Richard", greeting);Now run your application, passing in the hoime jar as a javaagent:

java -javaagent:hoime-1.0.jar ...Currently there is support for Guice, Spring and Pico dependency injection. Constructor injection is not supported. See test suites for examples.

Tags

spring guice dependencyinjection di

In a Nutshell, hoime...

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    by exploring contributors within projects, you can view details on every commit they have made to that project
  • ...
    in 2016, 47% of companies did not have formal process in place to track OS code
  • ...
    you can subscribe to e-mail newsletters to receive update from the Open Hub blog

Languages

Languages?height=75&width=75
XML
46%
Java
54%

30 Day Summary

Mar 21 2014 — Apr 20 2014

12 Month Summary

Apr 20 2013 — Apr 20 2014

Ratings

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!