Comment by [email protected]:
I have used guice for building a family of data acquisition engines on top
of the Apache MINA framework. The initial motivation was to allow each data
acquisition thread its own non-static logging facility. This worked out
amazingly well, and persuaded me that statics are almost never the best way
to go.
The next breakthrough for me was to see how injection could be used to
completely decouple classes, with all initializers being injected instead
of being supplied by the class client (as is often the case with "new").
This resulted in very versatile modules that could be added without forcing
significant changes to the surrounding code.
Final insights: 1) dependency injection is the O-O answer to the linker in
older languages, and offers similar benefits; 2) When used well, dependency
injection will totally change the way you think about coding; 3) the great
power of guice is that, because the api is all java, type safety is
enforced at compile time; 4) Yes, you can do dependency injection by hand,
but it gets very intractable when interfaces and abstract classes are
involved.
For more information:
http://code.google.com/p/google-guice/wiki/Motivation
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/groups/opt_out.