Book Image

Learning Google Guice

By : Hussain Pithawala
Book Image

Learning Google Guice

By: Hussain Pithawala

Overview of this book

<p>Google Guice is an open source software framework for the Java platform released by Google under the Apache License. It provides support for dependency injection using annotations to configure Java objects.</p> <p>Learning Google Guice is a concise, hands-on book that covers the various areas of dependency injection using the features provided by the latest version of Google Guice. It focuses on core functionalities as well as the various extensions surrounding Guice that make it useful in other areas like web development, integration with frameworks for web development, and persistence.</p> <p>Learning Google Guice covers Guice extensions which avoid complex API usage. You will start by developing a trivial application and managing dependencies using Guice. As the book gradually progresses, you will continue adding complexity to the application while simultaneously learning how to use Guice features such as the Injector, Provider, Bindings, Scopes, and so on. Finally, you will retrofit the application for the Web, using Guice not only to manage dependencies, but also to solve configuration related problems.</p>
Table of Contents (17 chapters)
Learning Google Guice
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 7. Developing Plugins and Extensions using Guice

In this chapter, we will visit important classes and interfaces which are useful for developing extensions and plugins around Guice. We will also explore these interfaces in terms of analyzing various kinds of bindings in guice-multibinder.

In this process, we will separate out MainModule from our application, and make it a part of a custom plugin that we are developing. This custom plugin would contain various examples related to SPI. This custom plugin is located at chapter_7/guice-analyst as a maven project; and the sample project, which uses this plugin is located at chapter_7/flights-struts-jpa-ext.