September 17, 2011 Leave a comment
One of the lessons I learned during the first 1/3 review of Making Java Groovy is there are two kinds of developers interested in the book: those who already know both Groovy and Java, and those who are only comfortable with Java. The goal all along has been to show how Groovy and Java can work together, and to do that I need to rely on a certain minimum knowledge of Groovy. I originally planned to add an appendix to the book that would act as a Groovy tutorial for those readers who wanted it, with special attention to existing Java developers who hadn’t worked with Groovy yet.
While that plan was arguably reasonable, I quickly learned that I needed to add those tutorial chapters sooner rather than later. Java developers reading the MEAP (Manning Early Access Program) were almost immediately out of their depth, and knowing that a tutorial chapter was going to be added eventually didn’t help.
Therefore, two new chapters have been added to the MEAP over the past few weeks. One is called ”Groovy by Example,” and is the new Chapter 2. In this new chapter, I walk through a few small but non-trivial examples of interesting problems that I solve with Groovy, highlighting aspects of the language as I go. I hope the Java developers find that helpful, and the Groovy developers like the approach, or at least like the applications. I especially go through my Groovy Baseball example in some detail, which hopefully readers will find interesting.
The other new chapter is called “Groovy by Feature”, which is a more traditional tutorial introduction to Groovy, filled with small, self-contained snippets of Groovy code for each feature. The plan was for this to be a regular chapter, but we (my editor, mostly) realized that it probably works better as Appendix A, which is where it is now.
By following the standard tutorial approach in one chapter and an example-based approach in another, hopefully I’ll meet the needs of developers with either learning style.
Now that those are in the MEAP, I’m working on the chapter on testing, which will include GroovyTestCase, StubFor and MockFor, Expandos, and, of course, Spock. I’m still trying to decide whether to include sections on easyb and Cucumber, or whether that will make the chapter too long. Any feedback is welcome on that.