Book description
In object-oriented programming, a central program normally controls other objects in a module, library, or framework. With dependency injection, this pattern is inverted—a reference to a service is placed directly into the object which eases testing and modularity. Spring or Google Guice use dependency injection so you can focus on your core application and let the framework handle infrastructural concerns.
Dependency Injection explores the DI idiom in fine detail, with numerous practical examples that show you the payoffs. You'll apply key techniques in Spring and Guice and learn important pitfalls, corner-cases, and design patterns.
About the Technology
About the Book
What's Inside
- How to apply it (Understand it first!)
- Design patterns and nuances
- Spring, Google Guice, PicoContainer, and more
- How to integrate DI with Java frameworks
About the Reader
Readers need a working knowledge of Java but no prior experience with DI is assumed.
About the Author
Dhanji R. Prasanna is a Google software engineer who works on Google Wave and represents Google on several Java expert groups. He contributes to Guice, MVEL, and other open source projects.
Quotes
Transcends implementation details...covers customary and effective use of DI.
- Bob Lee, Software Engineer, Google Inc. and Creator of Guice
Most comprehensive coverage of DI I have seen.
- Frank Wang, DigitalVelocity LLC
A handy manual for better programs with less code.
- Jesse Wilson, Guice 2.0 Lead, Google Inc.
Dependency injection is not just for gurus - this book explains all.
- Paul King, ASERT
A fantastic book...makes writing great software much easier.
- Rick Wagner, Acxiom Data Products
Table of contents
- Praise from the Creator of Guice
- Copyright
- Preface
- Acknowledgments
- About This Book
- About the cover illustration
- 1. Dependency injection: what's all the hype?
- 2. Time for injection
- 3. Investigating DI
- 4. Building modular applications
- 5. Scope: a fresh breath of state
- 6. More use cases in scoping
- 7. From birth to death: object lifecycle
- 8. Managing an object's behavior
- 9. Best practices in code design
- 10. Integrating with third-party frameworks
-
11. Dependency injection in action!
- 11.1. Crosstalk: a Twitter clone!
- 11.2. Setting up the application
- 11.3. Configuring Google Sitebricks
- 11.4. Crosstalk's modularity and service coupling
- 11.5. The presentation layer
- 11.6. The persistence layer
- 11.7. The security layer
- 11.8. Tying up to the web lifecycle
- 11.9. Finally: up and running!
- 11.10. Summary
- A. The Butterfly Container
- B. SmartyPants for Adobe Flex
Product information
- Title: Dependency Injection
- Author(s):
- Release date: August 2009
- Publisher(s): Manning Publications
- ISBN: 9781933988559
You might also like
book
Mastering Ninject for Dependency Injection
For .NET developers and architects, this is the ultimate guide to the principles of Dependency Injection …
book
Java 9 Dependency Injection
Create clean code with Dependency Injection principles About This Book Use DI to make your code …
book
Google Guice: Agile Lightweight Dependency Injection Framework
Guice (pronounced "Juice") is the Jolt Award-winning, 100% Java icing on the cake of Java dependency …
book
Hands-On Dependency Injection in Go
Explore various dependency injection methods in Go such as monkey patching, constructor injection, and method injection …