Guice Servlets Integration

Using Google Guice in web applications can raise some issues. First of all when we talk about web applications we talk about servlets and we talk about managed environments. The creation of servlets in not controlled by us, when we write the application, it is controlled by the web application container. This generates some problems:
– Because we can not control the servlet creation we can not use Guice to inject servlet members in the classic way.
– Bootstrapping: we need a mechanism to bootstrap Guice into the application. The best way is to do it at start up before any http request will be invoked.
Continue reading

Google Guice Tutorial

What is Google Guice

Google Guice is a light java dependency inversion framework using annotations. It is developed by Google(Bob Lee and Kevin Bourrillion) and it is used internally by Google for their applications. Google Guice is sometimes considered an Inversion of Control Container but as their authors state it’s not a container, it’s just an Dependency Injector, being too Continue reading

Google Guice Starts a New Google Age?

Google Guice is a an open source Java framework released by Google under Apache License 2.0. Guice is a light weight Inversion of Control Container. It does what Spring does regarding dependency inversion aspect, without using xml files. Guide uses annotations and requires Java 1.5 or above and follows the Google philosophy of being really easy to use.

Continue reading