Book Review

Building Microservices – by Sam Newman


TLDR: If you are looking for an introduction to and overview of the current ‘microservice’ landscape and the concepts and thinking behind it, then look no further. I would recommend this book for architect, developer, QA and operations (DevOps)

Microservices are obviously a very hot topic at the moment, and everyone and their dog appears to have an opinion about this concept. Accordingly, writing a book about microservices and keeping everyone happy is going to be a challenge (and probably impossible).

In my opinion Sam has done a great job here and manages to provide key information on a range of relevant microservice issues, such as the motivations for microservices, how to model services, integration with other systems, deployment, testing, monitoring, security and architecting/implementing microservices at scale.

I’ve seen negative comments towards this book on other sites stating that more code examples should be provided, and although I appreciate their motivations, I don’t believe this will be the book to address these issues. In my experience, code contained within a book can quickly become stale, and the diversity of language (and the associated rate of change) that is currently being used to create microservice implementations would make pleasing everyone an impossible challenge. Instead I recommend people interested in code samples have a Google, or visit InfoQ, DZone or Voxxed where there is plenty of microservice implementation code.

In my opinion I will use this book much like I did the original ‘Continuous Delivery’ book by Jez Humble and Dave Farley – the book will provide an excellent high-level overview of the issues (and potential solutions), help me to understand core concepts and how key components and methodologies relate to each other, and also provide inspiration and pointers to further reading.

Much like I didn’t expect to create a full build pipeline implementation simply from reading the ‘Continuous Delivery’ book, I wouldn’t expect to build a complete microservice ecosystem from Sam’s book. However, after reading both books I began the respective tasks with a lot more insight then I originally had, and I made much smarter decisions (and knew what to look for when searching for more knowledge) once I understood the big picture.

As stated above, I would recommend this book for any software delivery role. I’ve personally seen the benefits of a microservice architecture when deployed for the correct use case, but the nature of this architecture creates new challenges whether you are a developer, QA or operations specialist.

(In the interest of full disclosure I did provide feedback on this book as it was being published via the O’Reilly Early Access program. However, I have endevoured to write a review that takes into account only the final published book.)

Java 8 Lambdas – by Richard Warburton


In a nutshell: If you are looking for a concise and high-impact guide to the core features of Java 8, then you’ve found the right book! Whether you’re just getting started with Java, or are a seasoned programmer, this book will help you get to grips with the new JDK 8 essentials such as Lambdas and Streams

I’m sure many people browsing this book will have heard about the recent (March ’14) release of Java JDK 8 and all of the associated excitement about ‘the biggest language changes’ since JDK 5, and no doubt you are looking to see if any of the current JDK 8 books are worth an addition to your programming bookshelf. My answer to that question for this book is a definite yes.

The book starts with a whistle-stop tour of the influences for the new language additions, such as Lambdas and Streams (with a nod to the much-vaunted ‘functional programming’), and then launches into explaining and demonstrating these key features in a well-paced and logical fashion. The stand-out chapters for me are 3, 4 and 5, in which you get to see many practical examples of where and how the new syntax (and new way of thinking) can save a lot of boilerplate typing and can also lead to much more expressive code.

As a relatively seasoned Java programmer, the examples and associated explanations had me up-and-running with the new features over the course of a weekend, and left me plenty of room (and motivation) to start experimenting in my own time with my new-found knowledge.

Data parallelism is covered well in Chapter 6, and the essential topic of testing (and a few associated gotchas with the new Lambda-driven approach) is covered nicely in the following chapter. Another excellent chapter is ‘Design and Architectural Principles’, which walks through some of the well-known design patterns and demonstrates to you that all of your current pattern knowledge doesn’t have to be thrown away when using a functional style of coding. There is also a great section in this chapter discussing how the new language features relate to Uncle Bob’s SOLID principles, and if you get chance I would also recommend searching for a companion talk by Richard on the Skillsmatter website.

Personally I think this book will end up alongside the classic Java books that I recommend to anyone looking to truly master the language, and this list includes such classics as ‘Effective Java’, ‘Java Concurrency In Practice’, ‘Java Generics and Collections’ and ‘The Well-grounded Java Developer’. Richard has done a great job of distilling the key elements of the new JDK 8 language feature, and presented them in a concise tour-de-force without skimping on detail. A job well done!

Disclaimer: I know Richard personally from his good work within the London Java Community, and was also a reviewer for an early version of this book. I have endeavoured to write an unbiased review, and would be happy to discuss any of my thoughts listed here via the review comments section below, or via personal communication. Anyone who has seen Richard present, or had the pleasure of pair-programming with him, will know he is very much the ‘real deal’ when it comes to Java wizardry, and so I whole-heartedly support his first foray into the world of publishing!

Click here to buy Java 8 Lambdas on Amazon UK

Data Science for Business – by Foster Provost and Tom Fawcett


In a nutshell: If you are looking for a simple (but not simplistic) introduction to nearly all of the underlying data science fundamentals then look no further, because this is the book for you! You’ll learn about data-analytic thinking, correlation, segmentation, model fitting/overfitting, similarity (k-NN etc.), clustering (k-means etc.), probability (Bayes et al), mining text, result evaluation etc., and more!

I often work as a software developer, and so like to think that I have a good working knowledge of data science (‘data analytics’, ‘big data’ etc.), which has been achieved through College/Uni education and also through the modern media and blog posts etc. However, I often struggled at times to fully understand, and perhaps more importantly knit together and apply, the core fundamentals of the topic. This book has provided exactly the explanations and ‘glue’ that I required, in that it delivers a very well structured (and paced) introduction and overview of data science, and also how to think in a ‘data-analytics’ manner.

If you preview the book on Amazon with the ‘look inside’ feature then what you see in the table of contents is exactly what you get. Every chapter delivers upon its title (and promised ‘fundamental concepts’), and frequently builds superbly upon topics introduced in early chapters. You’ll move seamlessly from understanding how to frame data science questions, to learning about correlation and segmentation, to model fitting and overfitting, and on to similarity and clustering. With a brief pause to discuss exactly ‘what is a good model’ you’ll then be thrust back into learning about visualising model performance, evidence and probabilities and then how to explore mining text.

The concluding chapters draw upon and summarise how to practically choose and apply the techniques you’ve learnt, and provide great discussion on how to solve business problems through ‘analytical engineering’. There is also some bonus discussion on other tools and techniques that build upon earlier concepts which you might find useful, data science and business strategy, and some general thinking points around topics such as the need to human intervention in data analysis and privacy and ethics.

The book is superbly written and reads very easily, which for the potentially dry topic of data science is worthy of praise alone. The majority of chapters took me each approximately an hour to read, and then another couple of hours to re-read and ponder upon (and sometimes looking at other provided references) to fully understand some of the more complex topics and how everything related together. Each chapter also provided plenty of pointers and experimentation ideas if I wanted to go away and practically explore the topic further (say, with the Mahout framework, or R, or scikit-learn/Pandas etc.). The book could probably be read by dipping in and out of chapters, but I think you’ll get a whole lot more from a cover-to-cover reading.

In summary, this is a superb book for those looking for a solid and comprehensive introduction to data science and data analytics for business, and I’m sure will that even the more experienced practitioners of the art will find something useful here. The book introduces topics in a perfect order, superbly builds your knowledge chapter after chapter, and constantly relates and reinforces the various techniques and tools your learning as it progresses. I wish more text/learning books were written this well!

Click here to buy  Data Science for Business: What you need to know about data mining and data-analytic thinking on Amazon UK (This is a sponsored link. Please click through and help a fellow developer buy some more books!)

Practical Unit Testing with TestNG and Mockito – by Tomek Kaczanowski


TL;DR This is an essential book on Unit Testing for both novice and experienced Java developer alike. Practical Unit Testing provides a well-paced and logical introduction into the world of Unit Testing, and also offers the more experienced practitioners a discussion on topics such as defining what to test and verify, how to write high-quality and maintainable tests, and also when (shock horror!) not to test. This book provides a plethora of examples and is extremely pragmatic in it’s delivery of testing in the real world. I would also strongly recommend this book to any JUnit fans that haven’t experimented with TestNG lately – you might be surprised what this framework now offers!

Practical Unit testing is divided into five primary sections: ‘Developer’s Tests’, ‘Writing Test’, ‘Hints and Discussion’, ‘Listen and Organise’ and ‘Make them better’. It’s worth mentioning here that this flavour of the book strongly focuses on using TestNG and Mockito (there is a JUnit flavoured version, Practical Unit Testing with JUnit and Mockito). As mentioned above, if you haven’t played with TestNG lately, I would recommend that you do (with this book by you side), as the framework has developed rapidly over the past few years into a genuine competitor against JUnit.

Section 1, ‘Developer’s Tests’, begins by discussing motivations and the core methodology behind testing in general. Unit testing is then defined and the basic concepts introduced to the reader. Section 2 begins by getting the reader to write their first tests, and introduces key concepts such as assertions and parameterised tests.

Section 2 of the book continues with Chapter 4, which introduces the reader to Test Driven Development (TDD), and IMHO this chapter should be read by all Java developers. The author presents an excellent discussion on when to write tests, the ‘rhythm’ of TDD and the benefits offered, and also provides concrete examples. This chapter even covers when not to use TDD, which I know can be heresy to some advocates, but as a long time practitioner of TDD I can relate to points made by the author in this chapter.

As with any technique (or philosophy) as powerful as TDD it is easy to become dogmatic about the subject, and ultimately forgot that not every problem can be solved with a single approach or solution. Paraphrasing the author, he suggests problem areas with applying TDD can include not having a good knowledge of the problem domain, not understanding the technologies, and when working on legacy code. In my experience, I have made several mistakes with applying TDD in the areas identified, and so the author’s cautions should be well received (on a related topic, I can highly recommend Working Effectively with Legacy Code (Robert C. Martin) when dealing with testing legacy code)

Next is very useful discussion Mocks, Stubs and Spies, which is obviously focused on Mockito (which is currently my Mocking framework of choice). As with all the concepts discussed in this book, the example code provided is very useful and of high quality. On a related topic, I would definitely recommend a read of the Mockito website in addition to the this chapter, as the website includes a vast array of examples, and is also updated often.

Section 3 of the book kicks off with Chapter 6, ‘Things You Should Know’, and this chapter is again essential reading. In fact I would go so far to say that this part of the book is worth the entry fee alone – it covers a lot very interesting topics, such as knowing what to test, isolating code under test, making tests timely, using external data and dealing with concurrency. It also discusses what the author refers to as ‘points of controversy’, such as limiting multiple assertions per test (the logical assertions debate) and private method testing.

The remaining two sections of the book focus on getting feedback from tests (and what to do with it), how to organise your tests, and also how to write maintainable high-quality tests. This was an often overlooked topic in a lot of the earlier TDD books, and the often (unspoken) implication was that test code doesn’t have to be as high-quality as ‘production’ code, which is obviously a complete fallacy. In my experience poorly written (and brittle) tests can often slow development down considerably, and this ultimately leads to tests being either removed or ignored…

In summary, this is an essential purchase for any Java developer serious about testing and TDD. For some reason, this book appears to be under the radar to a lot of TDD advocates, and I’m not sure why. The current favourite TDD book, of which I am also a huge fan of, is Effective Unit Testing: A guide for Java developers, and I believe this TestNG-focused book is a great complement to the JUnit-focused work presented in Effective Unit Testing. Practical Unit Testing provides a great introduction for developers new to TDD, and also offers experienced TDDers plenty to think about. The book is well-paced and logical in it’s approach, and provides a comprehensive approach to writing useful, high-quality and maintainable tests.

Click here to buy Practical Unit Testing with TestNG and Mockito on Amazon UK (This is a sponsored link. Please click through and help a fellow developer buy some more books!)

Spring Data – by Mark Pollack et al


TLDR:  If you are working with Spring Data on a daily basis and want a complete and thorough overview of the framework then this book is all you will need. It covers all aspects of Spring Data without being overly verbose, and even if you have used Spring Data quite a lot already (like me), then I still believe you’ll discover something useful from this book. You will also find bonus chapters in context with Spring Data on Spring Roo, the REST repo exporter (very cool!), ‘Big Data’ via Hadoop, Pig, Hive and Spring Batch/Integration, and also coverage of GemFire.

I’ve been working professionally with Spring Data for quite some time now, both for ‘old skool’ RDBMS and also a lot of NoSQL (primarily MongoDB and Redis). The company I was working for at the time the Spring Data projects were approaching release were somewhat early-adopters, and in combination with the fact that their applications were firmly rooted in Spring made the decision to use this framework an easy choice. After some initial problems, which should be expected with a new technology (such as config issues and incompatibly between libraries bundled in JARs etc), Spring Data has provided a massive boost to productivity, and it is now my de facto choice when implementing persistence within Spring.

About the book itself: The first few chapters provide a great introduction to Spring Data, and describe the key motivations and techniques behind the framework. If you are simply modifying an already configured Spring Data app then this is all you need (but please do keep reading to learn more!). The next few chapters cover integration with an RDBMS, and also the popular NoSQL implementations – MongoDB, Neo4j and Redis. If you are working in one specific technology then reading the corresponding chapter will get you up and running quickly. Although Spring Data provides a common abstraction layer, it allows datastore-specific functionality to bleed through the interfaces (which is a good thing in my opinion, as it allows you to leverage specific features and strengths of the underlying technology), and this book will provide an excellent grounding and explanation of key concepts within each underlying datastore technology so that you can become productive quickly. Of course, you can also head over to the Spring Source website to learn the really advanced stuff (if you want to).

Part 4 of the book covers several interesting advanced features of the framework, such as using Spring Roo to auto-generate repository code, and also a brief guide on how to use the REST Repository Exporter. Metaprogamming and RAD tools like Spring Roo (and web-frameworks such as Grails and Play) are becoming increasingly popular in the industry, and so this chapter is a nice addition to the book. The REST exporter is also a very cool feature, and essentially allows you to expose CRUD functionality on your repositories via a REST interface. For anyone building a SOA-based app (or using micro-services etc) then encapsulating datastores and exposing simply functionality via a well defined HTTP-based API is very cool.

The final two parts of the book provide detailed coverage of using Spring Data to work with ‘Big Data’ through the use of Apache Hadoop, Spring Batch, Spring Integration and GemFire. Although this content wasn’t relevant to my initial decision to buy the book the chapters are a complete bonus in my opinion, and upon reading them I was even more happy with my purchase. The content provided is obviously quite high-level (as Big Data is a huge topic, no pun intended :)), but has enough detail to get you up and running with some Hadoop Jobs and Hive and Pig etc, which is a great skill to add to your CV.

I chose this book over the only other real competition for Spring Data coverage, Petri Kainulainen’s Spring Data, purely because this book offered more content. Obviously the book under review has more pages, ~280 vs ~160, but more importantly it covers a greater amount of topics, and Petri’s book focuses primarily on Redis (for which I was already familiar with). My main motivation for buying a Spring Data book was to learn about the ‘tips and tricks’, and I think either book would have met this need, but the coverage of other NoSQL technologies in the book under review, and the bonus chapters on Big Data technologies swayed my final decision. Now that I’ve read the book I am very happy with the decision.

In summary: This book will be all you need to master Spring Data, from key concepts to advanced usage. You’ll learn all of the ‘tips and tricks’ along the way, and also become familiar with Spring Roo, the REST repo exporter and fundamental techniques within Spring Data’s ‘Big Data’ processing (Hadoop, Spring Batch/Integration etc). I would recommend the book to any Spring developer, even one like myself who is happy learning about Spring from the excellent Spring Source website This book is a little more ‘polished’ than the Spring Source docs, and also provides concepts in well-structured and bit-sized chunks of information.

Click Here to buy ‘Spring Data‘ on Amazon (This is a sponsored link. Please click through and help a fellow developer to buy some more books!  )

Spring in Practice – by Willie Wheeler and Joshua White


TLDR; This is an excellent and comprehensive guide to advanced usage of the Spring framework. For anyone who is looking to further their knowledge gained from several years of Spring development in the trenches, this book will pay dividends. Although a Spring novice may be able to learn about Spring from this book, I would recommend picking up a copy of Spring in Action first, as the ‘In practice’ books can be quite fast paced!

As a seasoned Java developer I have been working with the Spring framework for many years now. One of the first Spring books I read was Spring in Action, and in combination with Java Persistence with Hibernate  this book has helped me complete many successful projects (I seriously owe the authors a few beers!). From the grounding provided in these book, and in combination with the excellent Spring Source website, I have been able to explore and develop my skills as the Spring framework has expanded – for example, the Spring Data project is now my go-to framework for all things NoSQL related. However, I always enjoy learning from advanced Spring practitioners and also from reading stories about real-world use and abuse of the framework, and I have yet to find a good book that meets this need – until now. ‘Spring in Practice’ satisfies this gap in the market perfectly.

The book is ~500 pages, and it manages to cram in a lot of content. Advanced usage of all the main Spring components is covered, and covered well. The first nine chapters provide a great grounding and advanced look at topics such as data persistence (ORM), Spring MVC, Web Flow and Security. The remaining chapters deep-dive into topics such as Integration Testing and Enterprise Integration (REST, RabbitMQ and IMAP integration etc), and really focus on how to write good (high-quality) code for the common but difficult tasks.

As the title suggests, the book’s focus is very much about practical usage of Spring. It’s not quite in the ‘cookbook’ style you may have seen with other books, but IMHO, this book is better organised for general learning (i.e. reading the book from cover to cover). The obvious advantage with a cookbook style reference is that it’s easy to cherry-pick solutions to problems, but I find that cookbooks can be difficult to read through if you simply want to learn. ‘Spring in Practice’ is logically structured, the book is nicely paced for the advanced developer, and the discussions of real-world problems and the related code sample solutions seek to further your knowledge and encourage exploration of Spring.

As mentioned above, I have worked with Spring for several years, but this book has taught me lot of new tricks – there’s nothing like finding a section of the book that leads to a ‘no way, Spring does that?’ moment 🙂 The author’s clearly have their own style of developing in Spring, and I personally would chose to do some things differently (e.g. I code the production of XML/JSON differently), but I can’t argue that what they’ve done isn’t best practice, and with a framework as large and wide-scoped as Spring, there is bound to be many approaches to do the same thing.

In summary, this is an excellent book, and one that should be on the bookshelf of any serious Spring developer. It will help deepen knowledge gained from ‘Spring in Action’, and also help to augment skills honed from time in the development trenches. I can almost guarantee that anyone who picks up a copy of this book, no matter how advanced they are, will learn something new. As you’ve no doubt guessed by now, I highly recommend this book, and I would like to offer my congratulations to the authors and Manning for writing a book which has long been needed by advanced Spring practitioners!

Click Here to buy ‘Java Persistence with Hibernate‘ on Amazon (This is a sponsored link. Please click through and help a fellow developer to buy some more books!  )

Java Application Architecture: Modularity Patterns with Examples Using OSGi: A Roadmap for Enterprise Development (Agile Software Development) – by Kirk Knoernschild


TLDR: This book is a thought-provoking peek into a topic that I believe will be highly influential in the next stage of evolution within software craftsmanship. The concepts presented within this book sit nicely in between the low-level ‘clean code’ philosophy (SOLID principles, Design Patterns, TDD etc) and the high level system/platform architecture principles (loose coupling, message orientation, event-driven systems, EIP etc). If you are serious about becoming a well-rounded developer or architect then this book is a must read.

I’m a freelance software architect/developer who primarily works on the JVM stack. I’m a strong supporter of Uncle Bob’s ‘Clean Code’ principles, and I spend a lot of time on InfoQ and various other sites learning about historical and current big-picture systems architectural approaches, but until reading this book I hadn’t thought too much about what happens in the middle of all of this. As a seasoned developer I now have several formuli for designing the big-picture architecture, and am happy creating (what I think is) well crafted code. But in the Java world packaging components together for deployment can feel clumsy at times (fat JARs or stuffed WARs anyone?). This book aims to address this discomfort.

The key premise of the book is ‘Architecture all the way down’, and although this may not make sense to you now, I have a strong suspicion that after reading the book and watching the online videos of the author (at Parleys) you’ll be nodding along enthusiastically (or at least thinking that more attention should be focused in this space). Several of the principles within this book are discussed within the context of OSGi, and although I’ve been aware of OSGi for quite a while now, it always seemed peripheral to what I was working on, and chatting with colleagues used to produce the ‘isn’t that the huge frameworks used to develop app servers?’ type conversations. Although the book doesn’t deep-dive into OSGi per se, it did help to clear up a lot of the mystery and intended design goals for me.

Just to address a few comments made by other reviewers on

* I also believe that this book will be suitable for a non Java developer/architect, although the reader may have to work a bit harder to relate the content to analogous frameworks and toolkit within their chosen language/platform.
* In regards to the review stating ‘not a general software architecture book’ I respectfully think the reviewer has missed the point of this book – ‘Java Application Architecture’ is clearly aimed at a well-defined and often over-looked niche within the software architecture domain, and should not be considered in isolation. It would be easy to say that a book on software design patterns is ‘not a good software development book’, but this is because the application of design patterns should be mixed with well-crafted code and other good design principles.

In summary, if you’re a fan of reading books like Uncle Bob’s inspiring Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin) and the ground-breaking The Pragmatic Programmer you are going to enjoy this a lot. It may not leave you with concrete implementation details, but it will make you think a lot about how you assemble your software components.

Bonus: Check out Kirk’s Devoxx talk on Parleys: Architecture All The Way Down.

Click Here to buy ‘Java Application Architecture: Modularity Patterns with Examples Using OSGi: A Roadmap for Enterprise Development (Agile Software Development)‘ on Amazon (This is a sponsored link. Please click through and help a fellow developer to buy some more books! ).