Advanced Search
Start Your Free Trial

Overview

Other Readers Also Read...
Algorithms of the Intelligent Web

Algorithms of the Intelligent Web
by Haralambos Marmanis; Dmitry Babenko

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. Readers need a working knowledge of Java but no prior experience with DI is assumed.

Amazon.com® Reader Reviews (Ranked by Helpfulness)

Average Amazon.com® Rating: 4.5 out of 5 rating Based on 5 Ratings

excellent material.. needs some editing - 2009-09-07
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
The information contained in this book is great. The author is very knowledgeable and enthusiastic. Don't let me dissuade you from buying this book, the information it contains is very valuable.

I have read several Manning books before and I didn't feel this book met their standards prior to publication. Another 10% of effort and this book would have gone from good to excellent. This is the reason I only give it 3 stars.

I have some issues with this book. First I don't feel that it has been edited tightly enough. Occasionally the informal language used by the author seemed awkward and I found a couple of grammatical errors.

I take issue that not all of the code snip-its are taken from working examples. (Download the sourcecode for corroborating evidence of this.) This is a bad idea given the size and amount of code snip-its. It is hard for the author to ensure there are no mistakes. There is at least one irritating one on pg. 88 in setting up the creation of a DelivererFactory.

And this is the only book that I can recall re-reading a section because I didn't quite follow it the first time through. I think this had to do with how sections of code changed as an idea evolved and how it was presented. It would have been very helpful to have an upfront sentence or three indicating where we are going when ideas evolve. For example, section 3.3.3 could have benefited from this. I found this particularly irritating at times.

Sometimes illustrations were used pointlessly, such as 7.4. Maybe I didn't see the humor in it. This is a dry subject after all.

I didn't like the flow of which dependency injection frameworks were chosen in any given section. Most of the time Guice would be presented first, but that wasn't always the case. There needs to be more consistency in the order of presentation! And for some reason not a peep was mentioned about Guice in section 7.5. Maybe Guice offers nothing in customizing the lifecycle of an object?

I also felt that chapter 4 needed help. I kept asking myself who this chapter benefited. The concepts of good object oriented design and testability take quite a bit of exposition. Books solely dedicated to this area have been written. And yet because of how dependency injection was presented along with it, I felt it muddied the waters in some ways. The information is good, it just needs more editing to make it more focused.

Chapter 11 is pretty useless until Google releases sitebricks. The whole chapter is a small web demonstration that happens to use this library. Who writes an extended example in a book which has a dependency on something not yet released to the public?? Again, Manning should not have let this problem go to press. Yes, the author also wrote sitebricks.. so I can imagine the conversation. "... it will be released a week after we start printing..."

I'd still recommend buying this book since I'm not aware of a better one on the subject of dependency injection.

Book review: Dependency Injection by Dhanji Prasanna - 2009-09-02
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Over the last few days, I have been reading Dependency Injection by Dhanji Prasanna published by Manning.
Summary first: very easy to read, a gold mine of knowledge and tips on a subject that is essential to the life of today's Java developers. Go buy it and keep it around your desk.

Let's quickly talk about the book structure. The book walks you gently through the DI (Dependency Injection) subject:

why do you need DI, what does it solves concretely in application developments
what is injection, what are the main concepts
using DI to improve application modularity
object scoping and how to approach that with DI solutions
best practices learnt with tears and blood
and a small concrete application showing how to use Guice as your DI container
If you are a beginner, this book will explain to you how and why using DI. If you are an expert and use DI on a daily basis, this book will help you rethink what you have taken for granted in DI-land and learn a handful of new tricks and design patterns.

I consider DI and the notion of scope (aka context) to be an essential knowledge to any Java developers. This will become even more pressing with the soon arrival of JSR-330 (Dependency Injection for Java) and JSR-299 (Context and Dependency Injection for the EE platform aka Web Beans) and their inclusion in Java EE 6.

Just like you had to learn polymorphism, you need to learn DI and context management as this is an essential tool for proper component design and application modularization.

The only gotcha is that this book comes right before the finalization of the two JSRs and hence does not cover them. Don't be too afraid though, all the core concepts covered by these specifications are thoroughly explained in this book. The problem / solution approach used by Dhanji will perfectly complement your knowledge of the DI JSRs.

My advice is to keep this book on your desk when you develop, you will save yourself the burden of learning the best design approaches the hard way.

[...]

Solid book about modular design for modern java systems - 2009-11-15
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Dependency Injection by Dhanji Prasanna is essential reading for anyone wanting to understand how to organise and structure modern Java codebases using Dependency Injection (DI) techniques.

Now that JSR-330 (Dependency Injection for Java) is part of the JDK, DI will become an important design technique for modularising and organising code, one that isn't taught in standard Java or OO texts. Up to now coverage on DI has been limited to online documentation, blog posts about testing, and sections here and there in books, so it's good to see sound engineering practice captured in one place. Dependency Injection covers two frameworks in detail - Spring and Guice and the coverage is balanced. As the author is a Guice contributor, this is to his credit - an easy out would be to write a book on just Guice.

I like that the book explains the principles behind DI and not just how certain frameworks work. I didn't think DI could justify a whole book and expected a lot of filler, but the title doesn't do justice to the material covered. Dependency Injection also has a wealth of practices and techniques for organising and programing Java systems. I don't think there's another book in print that provides the kind of information you can find here. Most DI material focuses on testing, which is important but just one aspect of why DI matters - this book goes beyond that and covers practical modular software architecture in some detail. Highly recommended.

The map to Modifiability... - 2009-10-27
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
As of today, no one has been able to convince me that the number one quality attribute, of every project with any amount of complexity, should not be Modifiability.

To be modifiable, an architecture must be modular. This book provides the tools needed to accomplish modularity.

This is hands down the best material on dependency injection available.

The beginning of the book is perfect for the beginner, but then gets into more advanced topics.

I can't speak to the usability of the code download because I am not a java guy.

You do actually get a free ebook that is downloadable. Not a 45 day temporary membership granting you access to it.

From the perspective of a C# developer, I found plenty of great advice throughout the entire book. The book covers some of the most important patterns and principles and I thought it did so well. The code samples were easy to understand.

If you want to build software that is modifiable, this book is a great place to start.

I highly recommend this book to all developers and architects.

Eye opener - 2009-09-08
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Reading Dependency In Action was an eye opener in the sense that it articulated what I instinctively knew, but what never quite crystalized in my mind. Also, there are interesting tips throughout the book about some of the common pitfalls when implementing DI, and even a chapter with tips for framework developers!

I think more people can learn from this book than they realize. In my experience, a lot of people use frameworks like Spring because everyone else does, without really understanding the core problems they solve. This book will give you that background.

I quite enjoyed the quirky funny writing style, though humor is something that is very subjective, so you may or may not be attracted to his writing style.

Some information on this page was provided using data from Amazon.com®. View at Amazon >


About Safari Books Online • Terms of Service • Privacy Policy • Contact Us • Corporate Licenses • Help • Accessibility | See us on FacebookSee us on Linked InSee us on TwitterRSS

Copyright 2009 Safari Books Online. All rights reserved.