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.

lutzhank (61) [Avatar] Offline
#1
MEAP 11/02/2010

1) Second paragraph first line
orig: "...composition and having the instance value hold the underlying
connection...."

Might be confusing because "instance value" seems ambiguous here (this or new Mongo).

suggestion: "...composition and having a member (underlying) holding the connection...."

2) Second paragraph last sentence
orig: "The following code demonstrates how it would
look if we..."

alternative suggestion:
"The following code shows how it would look like if we..."
(I suggested "demonstrate" previously for page 53 therefore here I would suggest "shows" here)

3) Third paragraph first to second line
orig: "...but you can also inline the definition of the primary
constructor of a superclass."

How could I inline the definition of the primary constructor of a superclass. I thought the code location of the primary constructor of a super class is in the definition of the super class?
Could you give an example? Maybe I miss something here.

4) Third paragraph third line
orig: "...handing it over to the superclass."


With the runtime view I would suggest the following:
"...handing it over to the superclass constructor."

5) Last paragraph before 3.3, 5th line
orig: "Even though extending Mongo as a superclass is a..."

I suggest to delete "as a superclass" because with the use of "extending" the inheriting context is already set.

6) Last paragraph before 3.3, 5th sentence
orig: "Even though extending...Mongo Java API"

Your argumentation, if I did understand correctly, is to prefer composition over inheritance for more control of the interface.
You could additionally argument with the violation of the Liskov substitution principle (LSP)
(http://en.wikipedia.org/wiki/Liskov_substitution_principle)

Explanation:
With extending class Mongo, our client must be able to replace an instance of the super class without code using a Mongo instance ("Client" code of Mongo) knowing our sub class, including the expected behavior. This might not be given for the constructor of MongoClientV2 itself with the required check and the error message, which might be unknown for or unexpected by code only knowing Mongo.

------------------------------
Corrected MEAP version
Message was edited by: lutzhank