Deal of the Day

Home » Main » Manning Forums » 2011 » The Well-Grounded Java Developer

Thread: Proposed changes to Chapter 3 - Feedback welcome!

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 6 - Pages: 1 - Last Post: Sep 12, 2013 9:32 AM by: martijn.verburg Threads: [ Previous | Next ]
martijn.verburg


Posts: 86
From: London
Registered: 1/26/11
Proposed changes to Chapter 3 - Feedback welcome!
Posted: Feb 19, 2011 9:12 AM
  Click to reply to this thread Reply

Hi all,

I feel that the Spring section is not in tune with the two preceding sections in the Chapter. It has been suggested to me that I mimic a subset of the Guice section using Spring 3 (this includes using annotations) and then go on to explain some of the extra Spring features.

Would people want to see that compare and contrast between Guice and Spring?

Would people prefer to see the annotation based examples or XML configuration based examples?

Cheers,
Martijn

z669016

Posts: 9
From: Netherlands
Registered: 7/11/07
Re: Proposed changes to Chapter 3 - Feedback welcome!
Posted: Feb 21, 2011 12:19 PM   in response to: martijn.verburg in response to: martijn.verburg
  Click to reply to this thread Reply

Hi Martijn,

I would like a comparison of two implementations both based on annotations. Would there even be any difference?
In addition I would like an additional paragraph (to both) on their additional features on top of the standard.
Are there any plans on the roadmap of the API regarding to these added features?

Kind regards,
René

martijn.verburg


Posts: 86
From: London
Registered: 1/26/11
Re: Proposed changes to Chapter 3 - Feedback welcome!
Posted: Feb 22, 2011 6:20 AM   in response to: z669016 in response to: z669016
  Click to reply to this thread Reply

Hi Rene,

That is a concern of mine in that I do not want the Spring section effectively repeating the Guice section (which in turn is repeating the DI section). I think I'm going to have to write some material and see how it looks.

I like your suggestion on having a subsection at the end of both Guice and Spring which points out extra features that the reader should go and explore.

Guice 3 is almost out and I am trying to get information about when Spring 3.1 comes out in order to decide which version of Spring I will cover.

Cheers,
Martijn

avysk

Posts: 10
From: Finland
Registered: 4/13/11
Re: Proposed changes to Chapter 3 - Feedback welcome!
Posted: Dec 12, 2011 2:57 PM   in response to: martijn.verburg in response to: martijn.verburg
  Click to reply to this thread Reply

I'm sorry to say it but the dependency injection chapter is one of the worst programming texts I've ever read. Maybe the text works well for the people who already know the material discussed in the chapter, but with having only general idea about dependency injection I was not able to understand much.

I would blame my ignorance, but in the beginning of the chapter we read that the chapter covers "The core concepts of Inversion of Control (IoC) and Dependency Injection (DI)". No, it does not. The text is messy, the language is heavy[1], the concepts are skimmed over, the examples are, well, strange. (Listing 3.2 is not a huge improvement of Listing 3.1. It's a code which solves different task from Listing 3.1, and requires much more boilerplate code around it than Listing 3.1.)

[1] "The @Qualifier annotation defines the contract for implementing frameworks that can be used to qualify (identify) the objects you wish to inject into your code." -- Try to draw a map of entities mentioned in this sentences (the annotation, the contract, frameworks, the objects, you, your code) and the relationships between them. I also would love to know what "to qualify (identify) the objects" means.

martijn.verburg


Posts: 86
From: London
Registered: 1/26/11
Re: Proposed changes to Chapter 3 - Feedback welcome!
Posted: Jun 11, 2012 11:43 AM   in response to: avysk in response to: avysk
  Click to reply to this thread Reply

Hi avysk,

That section has been revised, thanks for your feedback!

Cheers,
Martijn

bgoggin

Posts: 1
From: Montpelier, VA USA
Registered: 6/26/13
Re: Proposed changes to Chapter 3 - Feedback welcome!
Posted: Jun 26, 2013 12:45 PM   in response to: martijn.verburg in response to: martijn.verburg
  Click to reply to this thread Reply

Can you clarify the value of binding annotations in section 3.3.2? From the example, I don't see how using names helps in any way. The specific class to be instantiated is still referred to in Listing 3.9. It seems like using names just requires more configuration, but provides no value. Could you add an example where the class to be instantiated does not have to be specifically referred to? In other words, can it just be looked up by it's name? I've checked the Guice documentation, but their example is just like this one. The specific class to be injected is specifically referred to in the module, it is not just looked up by name.

martijn.verburg


Posts: 86
From: London
Registered: 1/26/11
Re: Proposed changes to Chapter 3 - Feedback welcome!
Posted: Sep 12, 2013 9:32 AM   in response to: bgoggin in response to: bgoggin
  Click to reply to this thread Reply

Apologies for taking so long to reply. So the purpose of the @Named annotation is if you have declared two objects of the same type, say a couple of configuration Singletons that hold some static data (one for PRD one for QA) and you need to be able to uniquely identify which one to inject. You could call one QA and the other one PRD.

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor