Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 289 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
small footprint dependency injection java

#1
I am looking for a very lightweight dependency injection framework for java.
With minimum possible dependencies and minimum features.

Just something along the following lines: receive a `java.util.List` of `Class`es, instantiate them and just auto-wire all the objects one into the other.

Reply

#2
Maybe you should have a look at Google Guice: [

[To see links please register here]

][1]


[1]:

[To see links please register here]

Reply

#3
I would recommend [Spring][1], since this can provide a small footprint when using only the core packages.

If you think Spring is overkill, then perhaps [PicoContainer][2], or [guice][3]?


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#4
Definitely look into Guice. Been using it for a year, and absolutely love it.
Reply

#5
I have been trying [MentaContainer][1] for less than a week now and I am satisfied by its clean and straightforward API. Instead of using XML or Annotations for the setup it uses a fluent API almost like a DSL which for me felt like like heaven because I am using it to build a small web container with IoC support. It provides a THREAD scope for the components which fits perfectly for the REQUEST scope of the web container. It is very lightweight so it may be what you need.


[1]:

[To see links please register here]

Reply

#6
[Silk DI](

[To see links please register here]

) is about `120K` single jar file with no further runtime dependencies. It has a fluent binder interface like guice but is more flexible and allows to remove features you don't like. E.g. `Collection` or `List` injection can be added in a *one liner*.
Reply

#7
Take a look at dagger2, developped at google (forked of square's dagger1), for only 17kb jar.

+ Much less boilerplate than guice
+ compile time verification of injection (with explicit error message. That's something spring, guice does definitly not)
+ generate Facotries, codes upon compile. **Very powerfull**


[dagger2 documentation][1]
[dagger2 github][2]
[dagger2 examples][3]


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through