New Book Review: "Drools Developer's Cookbook"

New book review for Drools Developer's Cookbook, by Lucas Amador, Packt Publishing, 2012, reposted here:

Drools_developers_cookbook

In my earlier review of "Instant Drools Starter", I mentioned that since it had been several years since I had last used a rules engine to any significant extent on a work project, and introductory Drools community documentation seemed to be lacking, I had thought it might make sense to pick up a text on Drools. Unfortunately, it was quickly apparent that very few books have been written on the product, and of the ones available in the marketplace only a couple have been recently written, the first being the object of my earlier review and the second being the subject of this review, both from the same publisher which seems to have the corner on the market right now with respect to Drools.

The taglines of this book indicate that it contains "over 40 recipes for creating a robust business rules implementation by using JBoss Drools rules" with "quick answers to common problems". As is the case with many other technical texts which are marketed as "cookbooks", potential readers can never really know what recipes are provided until the text is actually digested, and the quantity of such recipes can oftentimes be elusive (in this case it is 49, so the author should probably have just added another recipe to claim 50), although quantity can be a distraction, since recipes are often all over the map in terms of being lightweight or heavyweight, or even usefulness.

My focus has been Drools Expert, which is only one of five core modules of Drools (jBPM, Drools Expert, Drools Fusion, Drools Guvnor, and Drools Planner, which has been renamed Drools OptaPlanner since this book has been published), so I cannot fault the author for including content on other modules, despite the fact that Drools Expert is really the core module, but of the 49 recipes provided here, only 12 cover Drools Expert, covered in chapter 1 ("Expert: The Rule Engine") and chapter 2 ("Expert: Behind the Rules"). Later in the text, in chapter 6 ("Executing Drools Remotely") and chapter 7 ("Integration: How to Connect to Drools"), an additional 10 recipes fall within the scope of my focus as well, and because this content is really related to Drools Expert, in my opinion it should have followed the first two chapters.

Regardless, the other 27 rules fall within the domain of Drools Guvnor, Drools Fusion, Drools Planner, and jBPM. Because of the problem space that I was tackling on my work project, the descriptions of chapter 6 and chapter 7 were really what enticed me to actually purchased this book. But while I experimented with several of the recipes, such as "knowledge services and multiple endpoints configuration", "setting up Drools using Spring Framework", and "configuring JPA to persist our knowledge with Spring Framework", as an architect I consider much of the content for these recipes quick-and-dirty solutions, and the Drools community is really what helped me sort out all of the available options.

Of the first two chapters, two of the more valuable recipes for me personally were "adding logging to view rules execution behavior" and "using peristence to store knowledge". For this first recipe in particular, it is extremely difficult for me to convey just how difficult it is to find information about such seemingly trivial functionality, but I must say that this recipe provided much of what I needed to actually implement a solution. Notice that I qualified this statement with the word "much", because I adopted Drools 5.5.0.Final for my work project, the most recent stable version of the product at the time, and this text covers Drools 5.2.0.Final. Changes are needed to get even simpler recipes such as this to work with newer versions.

While I was able to eventually get some of the more Java intensive recipes to work, such as "using persistence to store knowledge", be aware that such recipes are not very straightforward, and will likely require perusal of what the Drools community offers on websites, including the API as well as the online documentation that I grew to appreciate as I progressed further into the project. One would think, for example, that this recipe would at least provide all of the Java that is needed to get it to work in some shape or form, but alas, unless the reader is very familiar with Drools Expert, they will need to search the APIs to determine all of the correct import statements just to get the code to compile.

In my review of the other Packt Publishing text, I mentioned that I needed to research how to make use of DRT (Drools Rule Template) files so that I would not need to be dependent on static files. While I did not expect that "introductory" book to cover this material, when looking at the index of this second book, it did seem to cover template topics to at least some extent. But the unfortunate reality is that templates are only covered very lightly in a recipe in one of the Drools Guvnor chapters, and once getting familar with the sparse information available on websites about this topic, I soon realized that I definitely did not want to go the route taken in the book.

Subscribe to Erik on Software

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe