The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

cemsultan (19) [Avatar] Offline
#1
Hi,

I have completed reading chapter 3 and I hope my following contributions will help in a positive way:

1. Upon reading about method references, the first thing that struck me was how the arguments were going to be worked out. The reason why I had this initial thought was that I didn't realise that method references can only be applied when mapped to functional interfaces. Therefore, my suggestion would be as follows:

(a) to make crystal clear that method references map functional interfaces and cannot be used directly

(b) even though a section on Type Inference 3.5.2 exists, but this section is in the context of lambda expressions. Therefore, it will be good to repeat the same information that Type inference is also performed by the JVM for method references in section 3.6.

(c) you mention in section 3.6.1 about 'repeating the parameters isn't necessary', but you stop there and this isn't enough information on its own. A brief explanation of this would be beneficial to the reader.

2. You mention there are 3 kinds of method references. I believe the information on method references to instance methods could be improved with an example like you do for the other 2 types. An attempt in Figure 3.4 (part 3) in my opinion is not clear enough. Here are my suggestions:

(a) Add something like this in point 3 in section 'Recipe for constructing method references' in page 58, Suppose we had an object instance myBook from class Book with an instance method getRating(), you can write: myBook::getRating

(b) Change figure 3.4 (block 3) on page 59, by replacing the word expr to objectName. That is, to replace..

(args) -> expr.instanceMethod(args) with an arrow to expr::instanceMethod

to..

(args) -> objectName.instanceMethod(args) with an arrow to objectName::instanceMethod


Thanks,
Cem
raoul-gabriel.urma (37) [Avatar] Offline
#2
Re: Final Recommendations For Chapter
Hi Cem,

Thanks for the excellent feedback. This is exactly what we need! Please keep it coming smilie I intend to update chapter 1, 3 & 4 for the next MEAP in 2-3 weeks. I will get back to you soon on how we tackled each of your suggestions.

Thanks,
Raoul