Shop now Shop now Shop now Cloud Drive Photos Shop now Learn More Learn more Shop now Learn more Shop Fire Shop Kindle Listen with Prime Pre-order now Shop Men's Shop Women's
Customer Review

1 of 1 people found the following review helpful
3.0 out of 5 stars A mixed bag, 10 Jan. 2010
This review is from: Grails Persistence with GORM and GSQL (Paperback)
This book has some some five star content in places.
I've picked up a few new Groovy tricks to add to my coding repertoire and I'd recommend this book for that alone.
The book demonstrated things with extensive use of Assert statements which was good.

But there are a few things that irked me and hence the loss of a couple of stars (points 5-7 lose a star and points 8 & 9 causes loss of a second).
1) Comments showing artifact names weren't in some other font or bold or in italics to show a clear deliniation between artifacts in an individual listing.
2) P25 Luke Daley's Injecto library. The link seems to have stopped working at the time I write this.
I looked on the Wayback machine and found it was also used in GLDAPO. Then I exchanged Tweets with Luke & he tells me the @mixin annotation have replaced this.
Guiilliame LaForge covers @mixin this in the Groovymag April 2009 issue (What's new in Groovy 1.6) and Craig Wickesser gave an example in Dec 2009 issue (Groovy MetaObject Programming).
3) P27 1-30 should be 1-32
4) P130.
- Firstly, it seems there are a couple of lines missing here to declare the Testing class and a comment to signify where the artifact is along with its name.
- Secondly the author quotes parameter mapping for Dates as not working in Grails Controllers. So statements like:
def foo = new Foo(params)
def foo = new Foo() = params
wouldn't work for Dates.

I investigated this a bit more and I think this was as a result of the test the author was performing not a Grails problem per se!
ie Date.toString() doesn't give a date in a format that the underlying Spring binding understands!

- I found a quote from Graeme Rocher on Nabble stating:
-- Default date format is "yyyy-MM-dd HH:mm:ss.S" but you can change this by defining a custom PropertyEditorRegistrar in resources.groovy that registers a new CustomDateEditor using whatever pattern you want.

- If you look at the API docs for java.util.Date.toString() you will find the format returned is
dow mon dd hh:mm:ss zzz yyyy (eg Sun Jan 10 11:06:01 GMT 2010)
So the binding obviously wouldn't work from the test given!

Date and Calendar are in fact a pet hate of mine in Java anyway. I wish the Groovy guys could tidy up the Java library. Thanks for commons.lang DateUtils parseDate tip Robert. I've been meaning to look into Yoda time too...

5) There must be a discrepancy with what is in print in places compared to something that would run.
For example:
6) Listing 1-14 on P12. The assertEquals above the shouldFail and the foo.ReadOnly should be swapped around.
7)P16 GORM does not update the lastUpdated property of a Domain class on Create
Try Googling on "Grails GORM Events".
Also lastUpdate needs a nullable constraint in ClassFoo as a result at top of page, and the FooTests should be assertNull foo.lastUpdated instead.

8) Parts of book were hard to fathom:
P24 Listing 1-28. The line that looks like a map calling a closure starting doAddedMethod:{-> This is some sort of MOP stuff I'm unaware of. Could have done with a better overview.
P29 - last four lines above listing 1-33
P41 At this point there is no support for using external or custom comparators on domain classes in GORM. (Wasn't sure what author was getting at here)
P61-65 The whole section on Custom Constraints and Listing 2-2 in particular.
After staring at this for a few minutes I suddenly realised Listing 2-2 was in fact three artifacts! This was not helped by the fact there were no blank lines either side of the
But it still didn't make it eay to understand the example and I particularly found the testListValueMessage perplexing.
I think once again this primariy came down to a map/closure like combo (P62-63) like the P24 example.
I just didn't get what listings 2-2 & 2-3 were supposed to be showing me!!
Bashar's Abdul-Jawad's Groovy & Grails Recipes - has a better example of this. I prefer examples based on a realistic validation, not some convoluted and contrived example. That, combined with the fact that book didn't set the scene well to describe the context in which you'd use this is what makes this difficult to follow.
P110 Sentence ending in 'appropriate' didn't seem to make sense. A wording issue. Perhaps appropriation? Who knows.

As a passing comment, the overloading of the term 'projection' seemed a bit odd too, to me.
It means different things in the context of Criteria Builder (P112) and HQL (P122).
The latter was the context I was familiar with as it relates to the way you would describe projections with SQL - ie column selection.

9) The book also left me with the impression that it was finished to a deadline, as some of the latter chapters were a little light in content.
They gave you pointers to go research, rather than give an example. Materialized views on P141 for example.

As a final footnote it would have been helpful if the book notified the reader against which version of Grails the tests were performed. As I'm wondering if embedded classes (value objects) and associations are now properly initialized too from the request parameters in Controllers. If the author had raised some JIRA issues and left references to those, it would have made it easy to check up on this.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Be the first person to comment on this review.

[Add comment]
Post a comment
To insert a product link use the format: [[ASIN:ASIN product-title]] (What's this?)
Amazon will display this name with all your submissions, including reviews and discussion posts. (Learn more)
This badge will be assigned to you and will appear along with your name.
There was an error. Please try again.
Please see the full guidelines ">here.

Official Comment

As a representative of this product you can post one Official Comment on this review. It will appear immediately below the review wherever it is displayed.   Learn more
The following name and badge will be shown with this comment:
 (edit name)
After clicking on the Post button you will be asked to create your public name, which will be shown with all your contributions.

Is this your product?

If you are the author, artist, manufacturer or an official representative of this product, you can post an Official Comment on this review. It will appear immediately below the review wherever it is displayed.  Learn more
Otherwise, you can still post a regular comment on this review.

Is this your product?

If you are the author, artist, manufacturer or an official representative of this product, you can post an Official Comment on this review. It will appear immediately below the review wherever it is displayed.   Learn more
System timed out

We were unable to verify whether you represent the product. Please try again later, or retry now. Otherwise you can post a regular comment.

Since you previously posted an Official Comment, this comment will appear in the comment section below. You also have the option to edit your Official Comment.   Learn more
The maximum number of Official Comments have been posted. This comment will appear in the comment section below.   Learn more
Prompts for sign-in

Review Details



Location: Milton Keynes, UK

Top Reviewer Ranking: 2,576,711